On Mar 15, 10:28 am, Eli Friedman <[EMAIL PROTECTED]> wrote:
> krithika wrote:
> > Hi,
>
> > After embedding mozilla I get the nsIDOMNSHTMLDocument with me.Is it
> > possible to execute javascript function calls on this.
>
> > If yes how do I do this?.
>
> Not sure what you mean. In C++, you can call DOM methods using syntax like:
> nsCOMPtr<nsIDOMElement> docElement;
> doc->GetDocumentElement(getter_AddRefs(docElement));
>
> If you need to run actual Javascript from within the context of the
> page, something like the following should work:
> var s = content.document.createElement('script');
> s.text = 'document.write("' + mystring + '")';
> content.document.body.appendChild(s);
> (You can convert this to C++ yourself; it's a little long.)
>
> Or you can probably use setTimeout.
>
> > Also where can I get all the command id that can be used in
> > execCommand call of nsIDOMNSHTMLDocument
>
> http://developer.mozilla.org/en/docs/Rich-Text_Editing_in_Mozilla#Exe...
>
> -Eli
Hi,
Thanks for sending me the command id details.Let me make my problem
clear.
> If you need to run actual Javascript from within the context of the
> page, something like the following should work:
> var s = content.document.createElement('script');
> s.text = 'document.write("' + mystring + '")';
> content.document.body.appendChild(s);
The above code will only append the js function how will it get called
or executed.
Please clarify.
regards,
Krith
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding