spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / javascript / professional / chap4 / 1 1234
[next]
Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Professional JavaScript

A JavaScript interpreter can't do much in a vacuum; it needs to work with a host program. The host program supplies all the interesting objects, functions and data that the interpreter operates on. Through these things, scripts can read input from a user, display output to a user, and perform computations in between.

Mainstream Browsers and JavaScript

JavaScript has its origins in the Internet and the World Wide Web, so it's no surprise that Web browsers are the places JavaScript is most frequently used. In most cases, this is achieved by adding JavaScript scripts to documents that normally only contain HTML tags and content.

Of the many, many Web browsers available; Microsoft's Internet Explorer and Netscape's Navigator and Communicator have the lion's share of the market. JavaScript's impact on these mainstream browsers is considered the 'ordinary case' and we'll be looking at those browsers primarily. In this chapter we'll also briefly consider some of the less well known alternatives. Alas, unless their popularity improves, the lesser known browsers are likely to occupy only small niches in the browser marketplace.

Adding JavaScript to HTML

An HTML document that contains JavaScript can be looked at from two points of view. Looked at from the outside, as a mere textual document, there are only select places in an HTML document where JavaScript scripts can be added. Looked at from the inside as a collection of tags and content items, an HTML document consists of numerous interesting features that can be manipulated by any scripts that can get at those features. It is the former view that is described here.

Since JavaScript scripts can only be placed in HTML documents in certain spots, opportunities for acting upon the document or the browser displaying the document are limited. However, what JavaScript can do in an HTML document is:

  • Affect document layout when HTML tags and content are still being loaded by the browser.
  • Affect document layout after HTML tags and content have been loaded by the browser.
  • Affect the number of browser windows and window-like objects currently displayed.
  • Capture, mimic and modify actions the user of the browser might make.
  • Perform basic automation and basic feedback tasks.
  • Improve on the simple forms that HTML supports.
  • Forward user actions onto applets, plug-ins and other foreign bodies embedded in the document.

Let's throw a little jargon in at this point. An HTML document may have JavaScript scripts embedded in it. The browser running these JavaScript/HTML pages hosts a JavaScript interpreter or has a JavaScript interpreter embedded in it.

home / programming / javascript / professional / chap4 / 1 1234
[next]

Copyright 1999 (1st Edition) and 2001 (2nd Edition) Wrox Press Ltd. and


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger


Created: February 12, 2001
Revised: March 5, 2001


URL: http://webreference.com/programming/javascript/professional/chap4/