HotJavaTM Browser JavaScript Support Exceptions

HotJavaTM Browser Version 3.0 interprets JavaScriptTM code contained within HTML pages. HotJava Browser 3.0 mirrors the Netscape NavigatorTM 3.0 handling of JavaScript, and in most cases this browser can be counted on to handle any script that Netscape Navigator can handle. HotJava Browser also reflects the ECMA Script standard (cited below).

However, several design decisions had to be made which cause HotJava Browser to deviate from the NetscapeTM model. This document outlines and explains those design decisions. It details the instances where HotJava Browser and Netscape Navigator do not behave in the same way. You should look for any topic not covered here in Netscape's JavaScript documentation.

Script Specification Links

Overall, HotJava Browser reads and handles JavaScript as outlined in Netscape's specifications, which are published on the Web:

General Exceptions to Script Specifications

There are several areas where HotJava Browser and Netscape Navigator differ in how they handle JavaScript code.

HotJava Browser does not support the following:

The other features of Netscape that are not supported by HotJava Browser can be grouped into three categories:

Intercepting Events

Document events: HotJava Browser does not implement any of the Netscape event capturing, routing, or releasing methods. To do so would require every possible event source to route its events through the JavaScript event hierarchy before processing them normally, which would cause performance problems. Because the Netscape Navigator method of event capturing differs so significantly from the event bubbling in Microsoft Internet Explorer, few web pages use these methods.

Image events: Image objects in HotJava Browser have no way to receive keyboard focus (though of course they can handle mouse events). Therefore, despite their appearance in the Netscape JavaScript specification, the key event handlers onKeyPress, onKeyDown, and onKeyUp have no effect on images in HotJava Browser.

Link events: Like Image objects, Link objects cannot receive keyboard focus under HotJava Browser. Therefore, defining key event handlers for them will have no effect.

In addition, the handleEvent() method is not implemented for any of the following classes of objects:

HotJava Browser Script Security Management

The JavaScript implementation in HotJava Browser adheres strictly and simply to the No Privilege model. Adherence to this policy is a security feature, ensuring that no JavaScript can invade your system via HotJava Browser. HotJava Browser does not acknowledge any security-overriding settings such as UniversalBrowserWrite, UniversalPreferencesRead, or the like.

The JavaScript Security documentation cites three ways security has been managed, which together span Netscape Navigator versions 2.0 through 4.0. HotJava Browser treats each method as follows:

LiveConnect

LiveConnect is the Netscape JavaScript/Java communication mechanism. In Netscape Navigator 4.0, JavaScript functions can call a Java applet's public methods and can get the values of its public members, and Java applets may call JavaScript functions. LiveConnect is documented online in the Netscape JavaScript Guide, Chapter 5.

The HotJava Browser implementation of LiveConnect is limited to one direction: JavaScript calls to Java. HotJava Browser does not support Java-to-JavaScript calls in this release because of the security issues this feature opens up and the incompatibilities between the way Netscape Navigator and Microsoft Internet Explorer handle this issue.

Other Exceptions

The following object variables, methods, and events are not implemented according to the Netscape specifications in the current HotJava Browser release. For the most part, they are not operational. If they are implemented, but in a different way, that difference is noted below:

<SCRIPT> attributes not implemented:

<SCRIPT> attributes implemented specially:

Date

Document

Event

FileUpload

Form

History

Image

Layer

HotJava Browser does not support the <LAYER> tag, so Layer objects are also not defined for its JavaScript implementation.

Link

Location

MimeType

Navigator

Plugin

HotJava Browser does not support Netscape-type plug-ins, so Plugin objects are not defined for its JavaScript implementation. The Plugins array on the Navigator object is implemented as an empty array, so that scripts referencing plug-ins will not fail when accessing the property.

Radio

Reset

Screen

Select

Submit

Text

TextArea

Window

Copyright © Sun Microsystems, Inc.