HTML and CSS Reference
In-Depth Information
So where is JavaScript now? As of December 2009, the ECMA-262 Standard is in its 5th
edition. JavaScript is a dialect of ECMAScript, but JavaScript 1.8 is comparable to
ECMAScript, edition 3 and is currently the most widely used version (JavaScript 1.9 is
available for download). To understand some of the proposals for a JavaScript2 version
(ECMAScript Edition 4), Brian Eich, the creator of JavaScript, wrote an interesting arti-
cle a few years ago that he published on the Web. If nothing else, it tells you some of the
pros and cons of the current state of the JavaScript language and the obstacles faced in
trying to change it. See Figure 1.10.
1.10.2 Does Your Browser Follow the Standard?
Modern browsers are using versions of JavaScript 1.5 or above, which generally follow
the standards set by the W3C. The snippet of code in Example 1.4 tests to see if you are
using a modern version of JavaScript that follows the standard DOM (see Figure 1.11).
Both the getElementById and createTextNode are part of the W3C standard, which sup-
ports the DOM.
<script type="text/javascript">
if (document.getElementById && document.createTextNode){
alert("DOM supported by " + navigator.appName);
Figure 1.11 Internet Explorer supports the standard.
1.10.3 Is JavaScript Enabled on Your Browser?
To see if JavaScript is enabled on your browser, you can check the options menu of
Firefox by going to the Tools menu/Options/Content. If using Apple's Safari browser,
go to Safari menu/Preferences/Security and with Internet Explorer, go to the Tools
menu/Internet Options/Security/Custom Level and enable Active scripting (see Figure
1.12). If using Opera go to the Opera menu/Preferences/Advanced/Content and click
Enable JavaScript. An easy way to test if your browser has JavaScript enabled is to go
to the Web site and follow directions (see Fig-
ure 1.13).
Search WWH ::

Custom Search