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

Simply JavaScript

By Kevin Yank and Cameron Adams
What’s Covered in this Book?
  • Chapter 1: The Three Layers of the Web: A big part of learning JavaScript is learning when it’s the right tool for the job, and when ordinary HTML and CSS can offer a better solution. Before we dive into learning JavaScript, we’ll take a little time to review how to build web sites with HTML and CSS, and see just how JavaScript fits into the picture.
  • Chapter 2: Programming with JavaScript: JavaScript is a programming language. To work with it, then, you must get your head around the way computer programs work—which to some extent means learning to think like a computer. The simple concepts introduced in this chapter—statements, variables, expressions, loops, functions, and objects—are the building blocks for every JavaScript program you’ll ever write.
  • Chapter 3: Document Access: While certain people enjoy writing JavaScript code for its own sake, you wouldn’t want to run into them in a dark alley at night. As a well-adjusted web developer,you’ll probably want to use JavaScript to make changes to the contents of yourweb pages using the Document Object Model (DOM). Lucky for you, we wrote a whole chapter to show you how!
  • Chapter 4: Events: By far the most eventful portion of this book (ha ha ha … I slay me), this chapter shows you how to write JavaScript programs that will respond to the actions of your users as they interact with a web page. As you’ll see, this can be done in a number of ways, for which varying degrees of support are provided by current browsers.
  • Chapter 5: Animation: Okay, okay. We can talk all day about the subtle usability enhancements that JavaScript makes possible, but we know you won’t be satisfied until you can make things swoosh around the page. In this chapter, you’ll get all the swooshing you can handle.
  • Chapter 6: Form Enhancements: I know what you’re thinking: forms are boring. Nobody leaps out of bed in the morning, cracks their knuckles, and shouts, “Today, I’m going to fill in some forms!” Well, once you trick out your forms with the enhancements in this chapter, they just might. Oh, and just to spice up this chapter a bit more, we’ll show you how to make an element on your page draggable.
  • Chapter 7: Errors and Debugging: When things go wrong in other programming languages, your computer will usually throw a steady stream of error messages at you until you fix the problem. With JavaScript, however, your computer just folds its arms and gives you alook that seems to say, “You were expecting, maybe, something to happen?” No, English is not your computer’s first language. What did you expect? It was made in Taiwan. In this chapter, we’ll show you how to fix scripts that don’t behave the way they should.
Read More/Download

JavaScript cheat sheet

The JavaScript cheat sheet is designed to act as a reminder and reference sheet, listing methods and functions of JavaScript. It includes reference material for regular expressions in JavaScript, as well as a short guide to the XMLHttpRequest object. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size JavaScript cheat sheet.
JavaScript has a huge number of methods and functions available. The cheat sheet lists these in various sections. On the left is a list of simple methods in JavaScript. On the right are DOM methods. Functions are in their own section at the bottom of the page.
The XMLHttpRequest object is relatively new to JavaScript. It is used to make requests and receive responses in XML format from a server, allowing developers to create interactivity with the server without the need for page refreshes (see the "Live Search" on the right of this page for an example). This section of the cheat sheet is a short reference to the object, containing a list of useful methods and properties, the syntax for creating the object in different browsers, and the various readyState values.
Read More/Try It

Acrobat JavaScript Scripting Guide

Welcome to the Adobe Acrobat JavaScript Scripting Guide. This scripting guide is designed to provide you with an overview of how you can use Acrobat JavaScript to develop and enhance standard workflows, such as:
  • Printing and viewing
  • Spell-checking
  • Stamping and watermarking
  • Managing document security and rights
  • Accessing metadata
  • Facilitating online collaboration
  • Creating interactive forms
  • Customizing interaction with Web Services
  • Interacting with databases
Here you will find detailed information and examples of what the Acrobat JavaScript capabilities are and how to access them, as well as descriptions of the usage of the SDK tools. Acrobat JavaScript is a powerful means by which you can enhance and extend both Acrobat and PDF document functionality.
Acrobat JavaScript is a language based on the core of JavaScript version 1.5 of ISO-16262, formerly known as ECMAScript, an object-oriented scripting language developed by Netscape Communications. JavaScript was created to offload Web page processing from a server onto a client in Web-based applications. Acrobat JavaScript implements extensions, in the form of new objects and their accompanying methods and properties, to the JavaScript language. These Acrobat-specific objects enable a developer to manage document security, communicate with a database, handle file attachments, manipulate a PDF file so that it behaves as an interactive, web-enabled form, and so on. Because the Acrobat-specific objects are added on top of core JavaScript, you still have access to its standard classes, including Math, String, Date, Array, and RegExp.
Read More/Try it

Followers