title: Get value from a javascript function in VBscript
body: <p>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):</p>
  
  <pre><code>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
  </code></pre>
  
  <p>How can I get the value of "function()"? I'm aware that <a href="http://msdn.microsoft.com/en-us/library/ms536420%28v=vs.85%29.aspx" rel="nofollow">execscript always returns null</a>. I could have the javascript write an element, and then fetch its value, but I'm sure there's a better way.</p>