1

i have a html file saved in my internal memory which i am loading in my android webview,but i want to load the javascript from the internet.

Following is the code. My first chart using FusionCharts Suite XT

    </script>
    </head>
    <body>

    <div id="chartContainer">FusionCharts XT will load here!</div>
    </body>
    </html>

but the js file is not loading.Is this way correct?

3
  • Please, also show the activity code, where and how you are enabling Javascript. Commented May 2, 2017 at 6:29
  • As everyone said enable Javascript its true but make sure that you give the Internet permission that will be another reason for not loading the js file. Commented May 2, 2017 at 6:43
  • Possible duplicate of Loading local html file in webView android Commented Oct 13, 2018 at 16:18

1 Answer 1

1

You have to enable javascript inside your webview. Do this inside your onCreate method, on the class you use your webview:

    wv = (WebView) findViewById(R.id.WEBVIEWNAMEINYOURXML);
    wv.getSettings().setDomStorageEnabled(true);
    wv.getSettings().setJavaScriptEnabled(true);

Where you substitute WEBVIEWNAMEINYOURXML by the name of your webview inside your layout xml.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.