Android Question Why does WebViewExtras.executeJavascript in webviewextras2 give Error : Object converted to String. This is probably a programming mistake.

Kita

New Member
Code which brings error:
Sub Button1_Click

    Dim jsCode As String

    jsCode = "var kit = $('.disappear').html(); B4A.CallSub('ShareMessage', true ,kit)"

    WVE1.executeJavascript(webview2, "jsCode")

End Sub

I have posted this thread because i found the solution. and the solution will be in the reply
 
Last edited:

Kita

New Member
Code fix:
Sub Button1_Click
    Dim jsCode As String
    jsCode = "var kit = $('.disappear').html(); B4A.CallSub('ShareMessage', true ,kit)"
    WVE1.executeJavascript(jsCode)
End Sub

In WebViewExtras2 you only need to mention the Javascript string, Since its already a String object you don't need to put it in quotes "".

Your Welcome
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…