applet | NN 3 IE 4 DOM 1 | ||||||||||||||
The applet object reflects the applet element. |
|||||||||||||||
HTML Equivalent | |||||||||||||||
<applet> |
|||||||||||||||
Object Model Reference | |||||||||||||||
[window.]document.appletName [window.]document.getElementById("elementID") |
|||||||||||||||
Object-Specific Properties | |||||||||||||||
|
|||||||||||||||
Object-Specific Methods | |||||||||||||||
None. |
|||||||||||||||
Object-Specific Event Handler Properties | |||||||||||||||
None. |
accessKey | NN n/a IE 4 DOM 1 |
Read/Write | |
This is single character key that either gives focus to an element (in some browsers) or activates a form control or link action. The browser and operating system determine if the user must press a modifier key (e.g., Ctrl, Alt, or Command) with the access key to activate the link. In Windows versions of IE 5 and later and Netscape 6, the Alt key is required and the key is not case-sensitive. For Macintosh versions of IE 5 and later and Netscape 6, the Ctrl modifier key is required to effect the action. |
|
Although listed here as a widely shared property, that isn't strictly the case across all implementations. Netscape 6 (per the W3C DOM) recognizes this property only for the following elements: a, area, button, input, label, legend, and textarea. To this list, IE 4 adds applet, body, div, embed, isindex, marquee, object, select, span, table, and td (but removes label and legend). IE 5 adds every other renderable element, but with a caution. Except for input and other form-related elements, you must also assign a tabindex attribute or tabIndex property value to the IE 5 and later element (even if it's simply a value of zero for all) to let the accelerator key combination bring focus to the element. As of Version 7, Netscape does not alter UI behavior if a script changes the property's value. |
|
Example | |
document.links[3].accessKey = "n"; |
|
Value | |
Single alphanumeric (and punctuation) keyboard character. |
|
Default | |
Empty string. |
align | NN 6 IE 4 DOM 1 |
Read/Write | |
Defines the alignment of the element within its surrounding container. Only partially implemented in Netscape 6.2. See Section 8.1.5 at the beginning of Chapter 8 for the various meanings that different values bring to this property. |
|
Example | |
document.getElementById("myApplet").align = "center"; |
|
Value | |
Any of the alignment constants: absbottom | absmiddle | baseline | bottom | left | middle | right | texttop | top. |
|
Default | |
left |
alt | NN 6 IE 6 DOM 1 |
Read/Write | |
This is the text message to be displayed if the object or applet fails to load. There is little indication that setting this property on an existing applet object has any visual effect. |
|
Example | |
document.myApplet.alt= "Image Editor Applet"; |
|
Value | |
Any quoted string of characters, but HTML tags are not interpreted. |
|
Default | |
None. |
altHTML | NN n/a IE 4 DOM n/a |
Read/Write | |
Provides the HTML content to be displayed if the object or applet fails to load. This can be a message, static image, or any other HTML that best fits the scenario. There is little indication that setting this property on an existing applet object has any visual effect. |
|
Example | |
document.myApplet.altHTML = "<img src='appletAlt.gif'>"; |
|
Value | |
Any quoted string of characters, including HTML tags. |
|
Default | |
None. |
archive | NN 6 IE 6 DOM 6 |
Read-only | |
Reflects the archive attribute of the applet element. Only partially implemented in the browsers. See the discussion of the archive attribute in Chapter 8. |
|
Example | |
if (document.applets["clock"].archive == "myClock.zip") { // process for the found class file } |
|
Value | |
Case-sensitive URI as a string. |
|
Default | |
None. |
blur( ) | NN 2 IE 3 DOM 1 |
Removes focus from the current object, at which time the object's onblur event fires. Note that the range of elements capable of focus and blur (both the event and method) is limited in all browsers except for more recent versions of IE (see the shared tabindex attribute in Chapter 8). Most reliably for backward compatibility, apply the blur( ) method to blatantly focusable elements, such as text input and textarea elements. Assigning the attribute onfocus="this.blur( );" to a text input element, for instance, is a crude but effective backward-compatible way to largely disable a field for browsers that do not provide genuine element disabling. |
|
Use blur( ) and focus( ) methods in moderation on the same page. You can inadvertently trigger endless loops of blurring and focusing if alert dialog boxes are involved along the way. Moreover, be aware that when you invoke the blur( ) method on one object, some other object (perhaps the window object) receives an onfocus event. |
|
Parameters | |
None. |
|
Returned Value | |
None. |
code | NN 6 IE 4 DOM 1 |
Read-only | |
Provides the name of the Java applet class file set to the code attribute. Not fully implemented in Netscape 7. |
|
Example | |
if (document.applets["clock"].code == "XMAScounter.class") { // process for the found class file } |
|
Value | |
Case-sensitive applet class filename as a string. |
|
Default | |
None. |
codeBase | NN 6 IE 4 DOM 1 |
Read-only | |
Provides the path to the directory holding the class file designated in the code attribute. The codebase attribute does not name the class file, just the path. Not fully implemented in Netscape 7. |
|
Example | |
if (document.applets["clock"].codeBase == "classes") { // process for the found class file directory } |
|
Value | |
Case-sensitive pathname, usually relative to the directory storing the current HTML document. |
|
Default | |
None. |
dataFld | NN n/a IE 4 DOM n/a |
Read/Write | |
It is unclear how you would use this property with an applet object because the dataFld and dataSrc properties (as set in element attributes) are applied to individual param elements. |
|
Value | |
Case-sensitive identifier of the data source column. |
|
Default | |
None. |
dataSrc | NN n/a IE 4 DOM n/a |
Read/Write | |
It's unclear how you would use this property with an applet object because the dataFld and dataSrc properties (as set in element attributes) are applied to individual param elements. |
|
Value | |
Case-sensitive identifier of the data source. |
|
Default | |
None. |
focus( ) | NN 2 IE 3 DOM 1 |
Gives focus from the current object, at which time the object's onfocus event fires. Note that the range of elements capable of focus and blur (both the event and method) is limited in all browsers except for more recent versions of IE (see the shared tabindex attribute in Chapter 8). Most reliably for backward compatibility, apply the focus( ) method to blatantly focusable elements, such as text input and textarea elements. |
|
To give a text box focus and pre-select all the text in the box, use the sequence of focus( ) and select( ) methods on the element. If this sequence is to occur after windows change (such as after an alert dialog box closes), place the methods in a separate function, and invoke this function through the setTimeout( ) method following the alert( ) method for the dialog. This allows IE/Windows to sequence statement execution correctly. |
|
Parameters | |
None. |
|
Returned Value | |
None. |
height, width | NN 6 IE 4 DOM 1 |
Read/Write | |
Indicate the height and width in pixels of the element as set by the tag attributes. Changing the values does not necessarily change the actual rectangle of the applet after it has loaded. Not fully implemented in Netscape 7. |
|
Example | |
var appletHeight = document.myApplet.height; |
|
Value | |
Integer. |
|
Default | |
None. |
hspace, vspace | NN 6 IE 4 DOM 1 |
Read/Write | |
Indicate the pixel measure of horizontal and vertical margins surrounding an applet. The hspace property affects the left and right edges of the element equally; the vspace affects the top and bottom edges of the element equally. These margins are not the same as margins set by style sheets, but they have the same visual effect. |
|
Example | |
document.getElementById("myApplet").hspace = 5; document.getElementById("myApplet").vspace = 8; |
|
Value | |
Integer of pixel count. |
|
Default | |
0 |
name | NN 6 IE 4 DOM 1 |
Read-only | |
This is the identifier associated with the applet. Use the name when referring to the object in the form document.appletName. |
|
Value | |
Case-sensitive identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character. |
|
Default | |
None. |
object | NN n/a IE 4 DOM n/a |
Read-only | |
Returns a reference to the applet object so that a script can access a property or method of the applet whose name is identical to a property or method of the applet element object. |
|
Value | |
Applet object (not the applet element object) reference. |
|
Default | |
None. |
src | NN n/a IE 4 DOM n/a |
Read-only | |
Internet Explorer defines this attribute as the URL for an associated file. The src property is not a substitute for the code and/or codebase properties. |
|
Value | |
Complete or relative URL as a string. |
|
Default | |
None. |
tabIndex | NN 6 IE 4 DOM 1 |
Read/Write | |
This is a number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabIndex properties are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabIndex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabIndex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabIndex property or have the value set to zero. These elements receive focus in the order in which they appear in the document. |
|
The W3C DOM and Netscape 6 limit the tabIndex property to the following element objects: a, area, button, input, object, select, textarea. To this list, IE 4 adds applet, body, div, embed, isindex, marquee, span, table, and td. IE 5 adds every other renderable element. A negative value in IE (only) removes an element from tabbing order entirely. |
|
Links and anchors cannot be tabbed to with the Mac version of IE 4, so the tabIndex property for a element objects is ignored in that version. |
|
Example | |
document.getElementById("link3").tabIndex = 6; |
|
Value | |
Integer. |
|
Default | |
0 |
vspace | |
See hspace. |
width | |
See height. |