This project is read-only.

Set/Register Document object

Jan 25, 2011 at 8:17 PM

I downloaded the library and started playing around with few javascript snippets. I love this already!

However, I have a question - how to set/register the DOM object (document) to the context, so that it supports the method calls like getElementById or write? Any help with this will be greatly appreciated.


Jan 25, 2011 at 8:32 PM
Edited Jan 25, 2011 at 8:33 PM

There's probably a misunderstanding about what Javascript.NET essentially does.

The engine doesn't come with any of the Web browser's usual APIs. As you probably noticed, no browser window shows up when Javascript.NET is initialized. Therefore, there's no HTML DOM exposed for manipulation. All Javascript.NET does is parse and execute Javascript, but it doesn't expose anything in regards to Web applications in particular.

A Web browser context is just a specific case of the generic purpose of Javascript.NET.

In order to use the DOM, you would need to find an API in C# (or any other .NET language) for that purpose and expose it to your context by registering these APIs.

We hope this helps. Thanks for using Javascript.NET.


The Noesis Team