spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column26


Specifying the JavaScript Version

Developer News
ActiveState Debuts Open Source Business Suite
Salesforce Offers Visual App Builder
Codesion Steps Out From CVS's Shadow

You can use the LANGUAGE attribute of the SCRIPT tag to specify the version of JavaScript that the script complies with. In fact, we use it all the time to distinguish between different versions of JavaScript. The line <SCRIPT LANGUAGE="JavaScript1.2"> directs the browser to interpret the script only if the version of JavaScript is 1.2 and to ignore the script if the version is higher than 1.2. Specify the JavaScript version if your script includes features that are not supported by other versions.

The default behavior for Netscape Navigator is to support the latest version of JavaScript that is supported by the browser. The latest version of JavaScript supported by Navigator 4.06 and 4.5 is 1.3. Therefore, the line <SCRIPT> is equivalent to <SCRIPT LANGUAGE="JavaScript1.3"> for these versions of Navigator.

To be html compliant (validator.w3.org) which we are switching over to, you need to add TYPE="text/javascript" to the script tag. So, the line

<SCRIPT LANGUAGE="JavaScript1.2">

becomes:

<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">

The following table reviews the history of JavaScript tags and identifies the browsers that supported them

Navigator VersionExecutes Code WithinIgnores Code Within
Earlier than 2.0No support for JavaScriptNo Support for JavaScript
2.0LANGUAGE="JavaScript"LANGUAGE="JavaScript1.1"
LANGUAGE="JavaScript1.2"
LANGUAGE="JavaScript1.3"
3.0LANGUAGE="JavaScript"
LANGUAGE="JavaScript1.1"
LANGUAGE="JavaScript1.2"
LANGUAGE="JavaScript1.3"
4.0-4.05LANGUAGE="JavaScript"
LANGUAGE="JavaScript1.1"
LANGUAGE="JavaScript1.2"
LANGUAGE="JavaScript1.3"
4.06-4.5LANGUAGE="JavaScript"
LANGUAGE="JavaScript1.1"
LANGUAGE="JavaScript1.2"
LANGUAGE="JavaScript1.3"
No Tags are ignored

http://www.internet.com


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Use Web Caching to Make Your Web Site Faster · Creating an Online Shopping Cart Mechanism in PHP · Log JavaScript Errors Using an AJAX-driven Web Service
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Configuring Granular Settings for a Database Level Audit · The Perils of a Web 2.0 Transition on Your Business Processes · Facebook Redesigns Site —Again — Nears 400M Mark


Created: September 28, 1998
Revised: September 28, 1998

URL: http://www.webreference.com/js/column26/version.html