• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 1. Jump-Starting JavaScript > A Tale of Two Interpreters

A Tale of Two Interpreters

A bit more serious problem exists between the two main interpreters, Netscape Navigator and Internet Explorer. Each has a slightly different way of translating JavaScript. Fortunately, only a few elements are translated differently, but, unfortunately, the differences can create major problems. The European Computer Manufacturer’s Association (ECMA) sets standards for JavaScript, and both Netscape and Microsoft generally adhere to these standards. However, for some reason, each has decided to have a slightly different way of interpreting JavaScript; when those differences are encountered, you need to know how to deal with them. In the meantime, be aware that JavaScript’s interpretation of a few commands and statements has slightly different structures for the two competing interpreters.

NOTE

To make matters more interesting, both of the major browsers keep improving on their products. At this writing, Netscape Navigator (NN) is part of Version 6 of Netscape Communicator, and Internet Explorer (IE) is in Version 5.5. However, the numbers don’t tell us much because NN skipped Version 5 altogether and went from Version 4.7 to Version 6. What is important is that the browsers are interpreters and that the interpreters determine what version of JavaScript each can read. Even though JavaScript 1.3 and 1.5 language elements are available, they’re still in testing. Realistically, JavaScript’s big developmental change came with JavaScript 1.2. While this book covers the new features added with JavaScript 1.3 and 1.5, most JavaScript in its newest configuration was present when JavaScript 1.2 appeared. The official revision version of JavaScript is ECMA-262, and JavaScript 1.2, 1.3, and 1.5 adhere to ECMA-262—with the exceptions that the browser manufacturers add. When JavaScript 2.0 is complete, you won’t have to learn JavaScript all over again. The goal is to have backward compatibility with earlier versions of JavaScript. So, learning JavaScript, where most of the revisions were put into JavaScript 1.2 , is a safe starting place for now and for later revisions.

In the meantime, don’t be overly concerned about all these different versions of JavaScript. Just be aware of them. If you use Version 4 and above on either of the major browsers, your JavaScript can be read just fine except where little differences of interpretation exist. You will be alerted to those places where the two major browsers part company and how to deal with the differences.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint