3

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

Thanks in advance, Parth Mehta

  • I don't have a direct answer, but maybe this is also interesting to you: http://stackoverflow.com/questions/475674/what-javascript-events-are-available-to-webkit-on-android – Mathias Conradt Aug 18 '10 at 09:49

1 Answers1

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;
Delan Azabani
  • 79,602
  • 28
  • 170
  • 210