Closed Thread Icon

Preserved Topic: Determine version of JavaScript supported by browser? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18538" title="Pages that link to Preserved Topic: Determine version of JavaScript supported by browser? (Page 1 of 1)" rel="nofollow" >Preserved Topic: Determine version of JavaScript supported by browser? <span class="small">(Page 1 of 1)</span>\

 
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 01-04-2002 16:01

Greets!

I am trying to determine what version of JavaScript is supported by a browser, via script. I thought something like this would work:

code:
<script type=text/JavaScript language="JavaScript1.0">
jsver = "1.0";
</script>
<script type=text/JavaScript language="JavaScript1.1">
jsver = "1.1";
</script>
<script type=text/JavaScript language="JavaScript1.2">
jsver = "1.2";
</script>
<script type=text/JavaScript language="JavaScript1.3">
jsver = "1.3";
</script>
<script type=text/JavaScript language="JavaScript1.4">
jsver = "1.4";
</script>
<script type=text/JavaScript language="JavaScript1.5">
jsver = "1.5";
</script>
<script type=text/JavaScript language="JavaScript1.6">
jsver = "1.6";
</script>
<script type=text/JavaScript language="JavaScript1.7">
jsver = "1.7";
</script>
<script type=text/JavaScript language="JavaScript1.8">
jsver = "1.8";
</script>
<script type=text/JavaScript language="JavaScript1.9">
jsver = "1.9";
</script>
<script type=text/JavaScript language="JavaScript2.0">
jsver = "2.0";
</script>



But I'm not well versed enough to know if this will work. I've read that NN doesn't allow detection, which is fine. But for IE, is this correct?

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 01-04-2002 18:42

Actually this is the most common method of detection I've seen.

Also I'm pretty sure that it's only up to 1.2 and then to the 2.0 spec so you shouldn't need all the others.



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 01-04-2002 20:01

Ok, but the problem is let's say I continue that mess through 10.0 (assuming 2.0 is the current version).

IE (6.0 on Windows 2000) will return 10.0, even though that's not valid. I was looking for something I wouldn't have to update each time a new js version comes out.

Ideas?

Synthetic
Paranoid (IV) Inmate

From: under your rug,
Insane since: Jul 2001

posted posted 01-05-2002 23:30

i think I tryed to do that once, but I think I ended up trying something like this...

(JAVASCRIPT VERSION CHECK)

if (this.nav2 &#0124; &#0124; this.ie3) this.js = 1.0
else if (this.nav3 &#0124; &#0124; this.opera) this.js = 1.1
else if ((this.nav4 && (this.minor <= 4.05)) &#0124; &#0124; this.ie4) this.js = 1.2
else if ((this.nav4 && (this.minor > 4.05)) &#0124; &#0124; this.ie5) this.js = 1.3
else if (this.nav5) this.js = 1.4

But I think you would still want to update this code when newer versions of JS are released.

« BackwardsOnwards »

Show Forum Drop Down Menu