01-20-2014, 09:47 PM
Hi -
I have a web page (a SHDocVw.WebBrowser control in a dialog) that is loading nicely in QM. When it loads I get a DocumentComplete callback; In that callback I get a SHDocVw.IWebBrowser2 object that I can walk with Document.getElementById() to get a particular DOM element and I can attach a OnPropertyChange callback to that.
So - any time the specified element changes in the web page I get a callback. This is all working smoothly.
I was wondering what the cleanest way would be to go in the other direction - is it possible to call InvokeScript or some other function where I could invoke a JavaScript function from inside of QM? I don't see anything in the API for this.
When I try this:
I get a Javascript error from inside the browser - so I think I'm close. (I have a JavaScript function named "blah").
Another alternative might be just to write out DOM elements and use jQuery change() callbacks to generate JavaScript calls. But I'd rather call JavaScript directly if I can.
Any help appreciated :-).
I have a web page (a SHDocVw.WebBrowser control in a dialog) that is loading nicely in QM. When it loads I get a DocumentComplete callback; In that callback I get a SHDocVw.IWebBrowser2 object that I can walk with Document.getElementById() to get a particular DOM element and I can attach a OnPropertyChange callback to that.
So - any time the specified element changes in the web page I get a callback. This is all working smoothly.
I was wondering what the cleanest way would be to go in the other direction - is it possible to call InvokeScript or some other function where I could invoke a JavaScript function from inside of QM? I don't see anything in the API for this.
When I try this:
I get a Javascript error from inside the browser - so I think I'm close. (I have a JavaScript function named "blah").
Another alternative might be just to write out DOM elements and use jQuery change() callbacks to generate JavaScript calls. But I'd rather call JavaScript directly if I can.
Any help appreciated :-).