Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi.
Why this code not works?
@ webView.evaluateJavaScript("document.onclick=myfunc;function myfunc(){alert('salam')}") @
The following works well. @ settings.javascriptEnabled is set to true. webView.evaluateJavaScript("alert('salam')") @
declare your javascript function before calling it : @ webView.evaluateJavaScript("function myfunc(){alert('salam')};document.onclick=myfunc;"); @
Same problem.
I solved. The problem was that I called this function on onUrlChanged event. I put it to onLoadingFinished. Now it works well.