3

I want to know the version of Javascript that is supported by the WebView in Android 1.6.

Thanks in advance, Parth Mehta

1

1 Answer 1

5

All modern browsers support JavaScript 1.5 at the least, most supporting 1.6 to 1.8.

That's not quite helpful enough though. To get the exact version, you could test for a single new feature in each version.

How can you do this? Create a test page to test the JavaScript version, and run it on the Android browser.

JavaScript 1.6 has a bunch of new Array functions. 1.7 introduces Iterator objects. JavaScript 1.8 introduces the reduce Array function. So we can test for these:

var jsVersion = 1.5;
if (([]).forEach) jsVersion = 1.6;
if (window.Iterator) jsVersion = 1.7;
if (([]).reduce) jsVersion = 1.8;
Sign up to request clarification or add additional context in comments.

1 Comment

For me (Android 3.0) this returns "1.8" Unfortunately there is no window.Iterator.

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.