Skip to Content
JavaScript: The Definitive Guide, Fourth Edition
book

JavaScript: The Definitive Guide, Fourth Edition

by David Flanagan
November 2001
Intermediate to advanced
936 pages
68h 43m
English
O'Reilly Media, Inc.
Content preview from JavaScript: The Definitive Guide, Fourth Edition

Netscape’s JavaScript 1.2 Incompatibilities

Netscape’s implementation of JavaScript 1.2 was released (as part of the Netscape 4.0 browser) while the ECMAScript v1 specification was still being finalized. The engineers at Netscape made some guesses about what would be in the specification, and based on those guesses, they made some changes to the way JavaScript behaved. Because these changes were not compatible with previous versions of JavaScript, the changes were implemented only when JavaScript 1.2 was explicitly requested. (In web browsers, this is done by setting the language attribute of the HTML <script> tag to “JavaScript1.2”.) This was an excellent way to introduce new behavior without breaking old scripts. Unfortunately, when work on ECMAScript v1 was completed, the new behavior that Netscape engineers had guessed at was not part of the standard. What this means is that Netscape’s implementation of JavaScript 1.2 has special-case behavior that is not compatible with JavaScript 1.1 and does not conform to the ECMAScript specification.

For compatibility with scripts that rely on the nonconforming behavior of JavaScript 1.2, all future implementations of JavaScript from Netscape have retained this special behavior when Version 1.2 is explicitly requested. Note, however, that if you request a version greater than 1.2 (with a language attribute of “JavaScript1.3”, for example) you will get ECMAScript-compliant behavior. Because this special behavior is present only in JavaScript ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

John Pollock
JavaScript Cookbook, 3rd Edition

JavaScript Cookbook, 3rd Edition

Adam D. Scott, Matthew MacDonald, Shelley Powers

Publisher Resources

ISBN: 0596000480Supplemental ContentCatalog PageErrata