Array from JavaScript
-
Hi all, Any idea about how could I return an array from the JavaScript code of a
WebBrowser
control? In another words: returning an array from a call ofDocument.InvokeScript
. Thank you.Bogdan.
-
:-D Well, it seems that it didn't cross my mind... Anyway, assuming that I do that, how should I interpret the answer on the .NET side? Chances are to get some COM wrappers of an interface I don't know. That's what I'm looking for, the appropriate interface to communicate through.
Bogdan.
-
:-D Well, it seems that it didn't cross my mind... Anyway, assuming that I do that, how should I interpret the answer on the .NET side? Chances are to get some COM wrappers of an interface I don't know. That's what I'm looking for, the appropriate interface to communicate through.
Bogdan.
-
:-D Well, it seems that it didn't cross my mind... Anyway, assuming that I do that, how should I interpret the answer on the .NET side? Chances are to get some COM wrappers of an interface I don't know. That's what I'm looking for, the appropriate interface to communicate through.
Bogdan.
Almost certainly IDispatch.
-
The return type for
Document.InvokeScript
isobject
. May be you should step through the code in the debugger and inspect what the return value contains.I tried that actually. In a script block in the head of the HTML doc:
function f() { return [1,2]; }
In the C# code:
var list = browser.Document.InvokeScript("f");
ToString(); // Breakpoint dummy :)Alas, list was null!