I have the following definitions:
Dim WVExtras As WebViewExtras
...
1) WVExtras.addJavascriptInterface(WebView1, "B4A")
2) WVExtras.addWebChromeClient(WebView1, True)
Execution:
3) js = "B4A.CallSub('processHTML', document.getElementById(""" & RankCol & """).style.color='red')"
Or:
4) js = "B4A.CallSub('processHTML', var elem=document.getElementById(""" & RankCol & """).value;elem.style.color='red')"
5) WVExtras.executeJavascript(WebView1, js)
With 2) and with 4), 5) doesn't work and I receive the following error msg: "Uncaught SyntaxError: Unexpected token var in file:/// (Line: 1)".
Without 2) and with 4), 5) doesn't work and I receive no error msg.
With 3) works perfecly without 2) and with 2).
How should I proceed for defining Javascript variables ?
Dim WVExtras As WebViewExtras
...
1) WVExtras.addJavascriptInterface(WebView1, "B4A")
2) WVExtras.addWebChromeClient(WebView1, True)
Execution:
3) js = "B4A.CallSub('processHTML', document.getElementById(""" & RankCol & """).style.color='red')"
Or:
4) js = "B4A.CallSub('processHTML', var elem=document.getElementById(""" & RankCol & """).value;elem.style.color='red')"
5) WVExtras.executeJavascript(WebView1, js)
With 2) and with 4), 5) doesn't work and I receive the following error msg: "Uncaught SyntaxError: Unexpected token var in file:/// (Line: 1)".
Without 2) and with 4), 5) doesn't work and I receive no error msg.
With 3) works perfecly without 2) and with 2).
How should I proceed for defining Javascript variables ?