Check Javascript version supported by your Mobile Device?

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;


http://efreedom.com/Question/1-3510767/Javascript-Version-Android

Comments

Popular posts from this blog

CSS Mouse Cursors and Custom Cursors

Block right click or disable keyboard on web pages

What is PAD file? "Submit your software with PAD file to Download.com"