spacer

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

home / programming / javascript / professional / chap4 / 1 1234
[next]
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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


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