Joe,
Thanks for your suggestion. I'm afraid the SCRIPT element doesn't have an innerText property. If I try to set it in the code I get the following exception "Property is not supported on this type of HtmlElement.".
Here is the code I'm using:
HtmlElement s = LPBrowser.Document.CreateElement("script");
try
{
//this line throws an exception
s.InnerText = "function test(){}";
}
catch(Exception ee)
{}
Do you have any ther suggetion?
Quote:
quote:Originally posted by joefawcett
Should be possible by following theses steps:- Get a reference to the document
- get a reference to the head element - getElementsByTagName("head")[0]
- create a new script element - document.createElement("script")
- Add the actual script to the script element using innerText
- Append the script element to the head
If all that is incomprehensible then you need to brush up on the Document Object Model. The process would be the same in a browser so maybe practice on that first to make sure it works.
--
Joe (Microsoft MVP - XML)
|