Call javascript from eclipse for PhoneGap

I am trying to download a website using Phonegap on Android with the following code:

   public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setBooleanProperty("loadInWebView", true);
    super.loadUrl("http://arriva.com.mt");

}

How can I execute a local javascript file in webview?

+3
source share
1 answer

I had problems with this, but I was able to solve it myself at the end. In your activity, you have inside your code - make sure you have a function with a window to run . Since you are using PhoneGap, I would suggest that javascript is already included in webview. If not, you also need to enable this, you may find my post helpful in figuring out this. super.loadUrl("javascript:yourFunction()"); window.yourFunction = function()

Call javascript functions in webview from activity class

NTN

+5
source

All Articles