Which version of JavaScript is supported by my browser?

JavaScript is a must for almost all the web applications. And like other programming languages, JavaScript’s many version are available. The commnads you used in coding will only be supported on browser support the version(or higher versions) when the corresponding commands were introduced. So many times we programmers, come across situations when our application’s javascript works fine on one machine but not on other. In such cases, we should first check the versions supported and write the code accordingly.Otherwise, the command not supported on some machines can even crash the application.

We can determine the javascript version supported by browser by using HTML along with JavaScript. To achieve this, follow the steps:

1. Open a notepad file, and paste this code in it.

<script type=”text/javascript”>

var myver= 1.0;

</script>

<script language=”Javascript1.1″>

myver = 1.1;

</script>

<script language=”Javascript1.2″>

myver = 1.2;

</script>

<script language=”Javascript1.3″>

myver = 1.3;

</script>

<script language=”Javascript1.4″>

myver = 1.4;

</script>

<script language=”Javascript1.5″>

myver = 1.5;

</script>

<script language=”Javascript1.6″>

myver = 1.6;

</script>

<script language=”Javascript1.7″>

myver = 1.7;

</script>

<script language=”Javascript1.8″>

myver = 1.8;

</script>

<script language=”Javascript1.8.1″>

myver = 1.8.1;

</script>

<script language=”Javascript1.8.2″>

myver = 1.8.2;

</script>

<script language=”Javascript1.8.5″>

myver = 1.8.5;

</script>
<script type=”text/javascript”>

document.write(‘<p><b>Javascript version ‘ + myver + ‘ supported<\/b><\/p>’);

</script>

2. Save this file as .html(e.g. version.html)

3. Now open this file with the browser on which you want to know the JavaScript version supported