11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

This object has the following properties, in addition to those in the Generic HTML Element<br />

object found at the beginning of this section:<br />

accessKey Single character string indicating the hotkey that gives the element focus.<br />

(IE4+, MOZ/N6+, DOM1)<br />

alt String defining text alternative to the graphic. (IE4+, MOZ/N6+, DOM1)<br />

coords String defining the (comma-separated) coordinates of the object, used with the<br />

shape attribute. (IE6+, MOZ/N6+, DOM1)<br />

hash String holding the portion of the URL in the href following the hash mark (#).<br />

(IE3+, N3+, MOZ)<br />

host String holding the domain name and port portion of the URL in the href. (IE3+,<br />

N3+, MOZ)<br />

hostname String holding the domain name portion of the URL in the href. (IE3+, N3+,<br />

MOZ)<br />

href String holding the value of the href attribute, the document to load when the link is<br />

activated. (IE3+, N3+, MOZ, DOM1)<br />

noHref Boolean indicating that the links for this area are disabled. (IE3+, MOZ/N6+,<br />

DOM1)<br />

pathname String holding the path and file name portion of the URL in the href<br />

(including the leading slash). Defined for Link in traditional models. (IE3+, N2+, MOZ)<br />

port String holding the port number portion of the URL in the href. (IE3+, N3+, MOZ)<br />

protocol String holding the protocol portion of the URL in the href. (IE3+, N3+, MOZ)<br />

search String holding the portion of the URL in the href following the question mark<br />

(also called the search string). (IE3+, N3+, MOZ)<br />

shape String defining the shape of the object, usually "default" (entire region), "rect"<br />

(rectangular), "circle" (circular), or "poly" (polygon). (IE4+, MOZ/N6+, DOM1)<br />

tabIndex Numeric value indicating the tab order for the object. (IE4+, MOZ/N6+,<br />

DOM1)<br />

target Specifies the target window for a hypertext source link referencing frames.<br />

(IE3+, N3+, MOZ, DOM1)<br />

x This Netscape 4–specific property, which is read-only, contains the x coordinate of<br />

the link in pixels, relative to the left edge of the document. (N4)<br />

y This Netscape 4–specific property, which is read-only, contains the y coordinate of<br />

the link in pixels, relative to the top edge of the document. (N4)<br />

Methods<br />

This object has the methods listed in the Generic HTML Element object found at the beginning<br />

of this section, in addition to the following:<br />

handleEvent(event) Causes the Event instance event to be processed by the<br />

appropriate handler of the object. (N4 only)<br />

Support<br />

Supported in Internet Explorer 3+, Netscape 3+, Mozilla, DOM1.<br />

Array (Built-in Object)<br />

Arrays store ordered lists of data. Data is stored at indices enumerated beginning with zero,<br />

which are accessed using the array access ([]) operator. Allocation of array memory is handled<br />

by the interpreter, so there is no need to explicitly resize arrays to accommodate more data. In<br />

addition, arrays are permitted to be sparse, that is, to have ―holes‖ consisting of an arbitrary<br />

number of unused indices. Any index that has not been assigned data has value undefined,<br />

and the highest index addressable is 232 –1 because indices are converted to unsigned 32-bit<br />

integers before use. <strong>JavaScript</strong> arrays are one-dimensional, but since array elements can be of<br />

any type, multidimensional arrays are supported as arrays with elements that are arrays.<br />

You can explicitly remove a value from an array using the delete operator, but there is no way<br />

to destroy an array other than by setting the variable that holds its reference to null.<br />

Constructor<br />

var instanceName = new Array([ val1 [, val2 [, val3 ... ] ] ]);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!