I'd like to get the execute a javascript function using IE and get its value in VBScript. I have the following VBscript code (the solution has to be in vbscript):
Dim oIE: Set oIE = CreateObject("InternetExplorer.application")
With oIE
.Visible = True
.Navigate (url)
End With
Do Until oIE.ReadyState = 4
wscript.sleep 100
Loop
oIE.Document.parentWindow.execScript("alert(function());") 'Get Return value
How can I get the value of "function()"? I'm aware that execscript always returns null. I could have the javascript write an element, and then fetch its value, but I'm sure there's a better way.