12

I am using Android and I have an HTML file which contains some Javascript. However, I am not able to get the Javascript code to execute. What do I need to do in order to run this code? Thanks in advance for any help.

0

3 Answers 3

15

Call getSettings().setJavaScriptEnabled(true) on your WebView, as JavaScript is disabled by default.

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

Comments

6
+25

@raj asked for credible and/or official sources

@CommonsWare answered:

Call getSettings().setJavaScriptEnabled(true) on your WebView

A simple search for the Android documentation provides the following official sources:

Comments

0

Here are few sources that will be surly helpful to you.

  1. Android Calling JavaScript functions in WebView
  2. call javascript inside webview.
  3. calling javascript function.

Hope this links will be helpful to you.

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.