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#Executing_Commands

-Eli
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to