Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

New JavaScript features in Navigator 3.0

Discover the new and improved JavaScript <br> functionality in Netscape's latest browser

  • Print
  • Feedback
In Greek mythology, Atlas was a luckless Titan condemned for all eternity to support the heavens upon his shoulders. Perhaps it is mere coincidence that Netscape used "Atlas" as the code-name for its latest version of the popular Navigator browser software. Or perhaps it is indeed an obscure reference to the burden Netscape carries in keeping the Internet free from the looming threat of Microsoft.

Whereas Zeus, god of all Greek gods, condemned Atlas to his everlasting hardship, it is Netscape who burdens itself with the task of competing for the centerpiece prize of the Internet, the world's standard Web browser. Netscape "Atlas" -- now better known as Netscape 3.0 -- is considered a major upgrade from Netscape 2.0, though you wouldn't know it by looking at it.

On the outside, Netscape 3.0 is much the same as the previous version, except for a small handful of noted enhancements (such as support of a few enhanced HTML layout features, including borderless frames).

Rather, it's the inside that's different, in ways the casual observer cannot see. One of the major improvements in Netscape 3.0 is JavaScript, the built-in scripting language that provides for interactive and intelligent control over the HTML content of a page. JavaScript is more mature and refined this time around, with many of its "version 1.0" bugs squashed. What's more, JavaScript supports a number of enhancements, including new object constructors, in-place image replacement, and direct communication between it and Java applets and plugins. Though JavaScript is far from being complete, it has taken another step in becoming a world-class user scripting language.

The new JavaScript features in Netscape 3.0 are actually very extensive. You'll want to check out the JavaScript documentation (http://home.netscape.com/eng/mozilla/3.0/handbook/javascript/index.html) for full details. I'll review the most important ones here, and of course, cover them in more detail in coming months.

Using the built-in object constructors

Netscape 3.0 sports a number of built-in object constructors to make programming easy. Three of them -- Date, Array, and Object -- are available in Netscape 2.0. Netscape 3.0 adds functionality to the Array constructor, as well as new object constructor functions.

As you may know, an object constructor is a built-in function that creates an object. For example, you can create an object with the current date with the following:

now = new Date();


Netscape 3.0 supports the following object constructors. In all cases these constructors are used with the new statement to create new instances of objects.

  • Array
  • Boolean
  • Date
  • Function
  • Images
  • Number
  • Object
  • Options
  • String


The Date and Object constructors have not been changed since Netscape 2.0. Following are descriptions of what's new with the Array, Boolean, Function, Number, and String constructors. The Images and Options objects are part of the new features in Netscape 3.0 that allow for in-place image replacement and dynamic updating of selection lists, respectively. See "Using the image object" and "Modifiable select objects" for more information about these.

  • Print
  • Feedback

Resources