JavaScript the Definitive Guide

by David Flanagan
There have been many changes in the world of web programming with JavaScript since the third edition of this book was published, including:
  • Second and third editions of the ECMA-262 standard have been published, updating the core JavaScript language. Conformant versions of Netscape's JavaScript interpreter and Microsoft's JScript interpreter have been released.
  • The source code for Netscape's JavaScript interpreters (one written in C and one written in Java) has been released as open source and is available to anyone who wants to embed a scripting language in his application.
  • The World Wide Web Consortium (W3C) has published two versions (or levels) of a Document Object Model (DOM) standard. Recent browsers support this standard (to varying degrees) and allow client-side JavaScript to interact with document content to produce sophisticated Dynamic HTML (DHTML) effects. Support for other W3C standards, such as HTML 4, CSS1, and CSS2, has also become widespread.
  • The Mozilla organization, using source code originally contributed by Netscape, has produced a good fifth-generation browser. At the time of this writing, the Mozilla browser is not yet at the 1.0 release level, but the browser is mature enough that Netscape has based its 6.0 and 6.1 browsers upon the Mozilla code base.
  • Microsoft's Internet Explorer has become the overwhelmingly dominant browser on desktop systems. However, the Netscape/Mozilla browser remains relevant to web developers, especially because of its superior support for web standards. In addition, minor browsers such as Opera and Konquerer should be seen as equally relevant.
  • Web browsers (and JavaScript interpreters) are no longer confined to the desktop but have migrated to PDAs and even cell phones.
In summary, the core JavaScript language has matured. It has been standardized and is used in a wider variety of environments than it was previously. The collapse of Netscape's market share has allowed the universe of desktop web browsers to expand, and JavaScript-enabled web browsers have also become available onnon-desktop platforms. There has been a distinct, if not complete, move toward web standards. The (partial) implementation of the DOM standard in recent browsers gives web developers a long-awaited vendor-independent API to which they can code.
Read More/Download

From DHTML to DOM scripting

By Chris Heilmann
In this article we will try to help JavaScript beginners to spot old and outdated JavaScript techniques and explain what their issues are. We do this by looking at a web page that might have been developed around the millennium with development ideas that were good at the time (DHTML), but result in inaccessible or even broken pages in today's web environment.
If you want to take a look at the code examples offline, you can download the example site as a zip.
This article is aimed at developers who are new to JavaScript, or those who haven't touched it in a while and wonder why people tell them off for using techniques that were the bee's knees in 1999.
We will take a demonstration page that features three dynamic elements using JavaScript, take a look at how they were achieved, and give an example of a modern way of re-creating them more future-proof and less in the way of the visitor (DOM scripting). Let's start with a bit of background knowledge about what DHTML and the DOM are.
Read More/Download

JavaScript Essentials

By Neil Smyth
Before JavaScript was created, a typical web browsing experience consisted largely of displaying static pages of information. Any type of user interaction with a web page usually involved the browser sending information back to the web server where some type of server based script or other program would validate the user's data input. The server would then send back either a static error page if the user had entered invalid data or, assuming successful validation, return a static page to the web browser containing the results of the transaction. In addition, the lack of a mechanism to implement dynamic web page content and behavior dictated that an entirely new web page be loaded in order to display new information.
It quickly became clear that a way of performing "client-side" or "web browser-side" processing was needed. The original intent for JavaScript, therefore, was to address this need by facilitating such tasks as validating user input before it is transmitted to the web server, and creating dynamic web page content and layouts independently of the web server (for example, displaying different text depending on a user's actions within the page).
JavaScript met and, indeed, exceeded these requirements by providing an extremely flexible and intuitive scripting language. The problem today is that, as with any useful technology, JavaScript has been used in ways never anticipated by its original authors. As a result, the potential uses of JavaScript have grown far beyond the needs of the average person looking to add dynamic behavior to web pages. The result of this is that JavaScript book authors also feel the need to cover every possible capability of JavaScript, often to the extent that the average JavaScript reference book now runs to over 1,000 pages.
The purpose of this book, therefore, is to provide the essentials of JavaScript so that anyone with a web site can use this powerful scripting language quickly and effectively without having to learn things that, whilst within the capabilities of JavaScript, aren't actually needed by the average web designer. That said this book does not take any shortcuts. It provides detailed and in depth knowledge of all aspects of JavaScript from language basics through to advanced topics.
This book is designed to provide a detailed and comprehensive, yet easy to follow, guide to developing powerful, dynamic web pages using JavaScript. It could be said that the object of JavaScript Essentials is to provide you with everything you need to use JavaScript, and nothing that you don't.
Read More/Download