I am trying to inject a javascript function into my webview running a server url "www.myserver.com". However, I am unable to do so. I tried several ways but didn't succeed. I tried setting up js alerts, which do not pop up upon reading the js file. I am not sure what I am doing wrong. Here's my code so far: my js file "page.js":
Here's my webview code:
Any ideas how to get the alerts to popup? Note: When I remove all the functions in js and just keep the alerts, the alert works,but after I re-add the necessary js functions the alert doesnt work anymore. Any idea what might be stopping it from injecting into the js as expected?