Accessibility

Table of Contents

JavaScript for web designers

What is JavaScript and the DOM?

JavaScript is an object-oriented scripting language used for client-side web development. Despite its name, it is essentially unrelated to the Java programming language, but does provide an excellent opportunity to make web pages more interactive.

The Document Object Model (DOM) is a platform- and language-neutral interface that allows programs and scripts, such as JavaScript, to dynamically access and update the content, structure, and style of XHTML documents. The DOM represents XHTML documents as a tree structure of elements. By traversing the DOM tree with JavaScript, you can reference all XHTML elements, their attributes, and the text they contain. You can also modify or delete existing elements as well as create and insert new ones.

So why should I bother with JavaScript now?

Three reasons: The rise of the Web 2.0 era, the release of Dreamweaver CS4, and the risk of being left behind.

With Web 2.0, JavaScript-based applications have become almost ubiquitous. The increasing demand for JavaScript development has led to the creation of a number of JavaScript libraries or frameworks that allow for easier development through their pre-written controls.

Dreamweaver CS4 is geared towards creating next-generation web experiences by supporting the following new features that assist JavaScript developers:

  • Live view: This feature lets you design your web pages under real-world browser conditions while still providing direct access to the code. Changes to the code are instantly reflected in the rendered display.
  • Code hinting for Ajax and JavaScript frameworks: This feature lets you write JavaScript more quickly and accurately with improved support for JavaScript core objects and primitive data types. You can put the extended coding functionality of Dreamweaver CS4 to work by incorporating popular JavaScript frameworks, including jQuery, Prototype, and Spry.
  • Code Navigator: This features lets you see all the code sources that affect your current selection, such as CSS rules, server-side includes, external JavaScript functions, Dreamweaver templates, iframe source files, and more.
  • Related files: This feature lets you manage the various files that make up today's web pages more efficiently. Click any related file to see both its source in Code view and the parent page in Design view.