Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21845

How to return value from Javascript

$
0
0
Hello ,
I'm trying to execute javascript (through Webbrowser Control) from visual basic 6 and get the result of execution back in visual basic.
The code for execution:
Code:

Private Sub Form_Load()
 Dim HmtlPath As String
 HmtlPath = (App.Path & "\test.html")
 WB.Navigate HmtlPath
End Sub

Private Sub WB_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WB.object) And (URL = App.Path & "\test.html") Then
    Dim strReturn As String
    strReturn = WB.Document.parentWindow.execScript("Test('strTest');", "JavaScript")
    Debug.Print strReturn
End If
End Sub

Function Test is executed but does not return a result
How can I get the result from Javascript ?

Viewing all articles
Browse latest Browse all 21845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>