JavaScript Version Identification script - March 25, 2008

Like all other programming languages JavaScript has been changed over the passage of time, often additional functionality is added to the language.
The commands introduced in new versions are only supported if your browser supports the same or latest version of JavaScript. If you are using a browser which does not support the new version of JavaScript it may crash the script or in rare cases crash the browser itself.
The solution to this problem is to either only use a JavaScript version which is supported by the visitor, or test which version is supported by the browser.
Using a combination of JavaScript and HTML we can determine which JavaScript version is supported by the browser. The script would be:

<script language="Javascript1.5">
ver = 1.5;
</script>
<script language="Javascript1.6">
ver = 1.6;
</script>
<script type="text/javascript">
document.write(’<p><b>Javascript version ‘ +ver
+ ‘ supported< \/b>< \/p>’);
</b></p></script>

If your browser doesn’t support the required version of JavaScript then you might need to upgrade your browser. It is a good SEO approach to ensure your site displays correctly whether JavaScript is supported or not, this ensures the search engine spiders always get access to all of your content.

Nadeem Hussain
SEO Programmer

  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • Wists
  • Furl
  • Spurl
  • Technorati
  • YahooMyWeb
  • Ma.gnolia
  • Reddit
  • Simpy
  • StumbleUpon
Listen to this podcast Listen to this podcast

No Comments

No comments yet.

RSS feed for comments on this post
TrackBack URI

Leave a comment

You must be logged in to post a comment.