Availability: |
| |||||
JavaScript syntax: | - | myLinkArray = myDocument.links | ||||
Object properties: | length |
This is a collection of Url objects. In Netscape, you can inspect the constructor to establish the class name which is masked by the toString() method of the Url object. In MSIE, you cannot get at the constructor so we have to assume that the object is a Url object.
Url objects are created when an <AREA> or <A> tag refers to a document. Anchors that are simply named locations within a document but which don't have an HREF get added to the anchors array but not to the links array.
Netscape prior to version 6.0 calls this a LinkArray (as opposed to a LinksArray which might be more appropriate). In MSIE it is just a Collection and in Netscape version 6.0 it has become an HTMLCollection because that is what DOM specifies it should be.
Be careful not confuse the elements of this array with LINK objects. These are used in MSIE to support styling of Url objects on the screen. Other documentation may refer to Link objects but there is no evidence to support the existence of an object of that class. After inspection there appear to be Url objects in Netscape, LINK objects in MSIE and an object in MSIE that corresponds to the Netscape Url class but which provides no means of examining its constructor.
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
length | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
Prev | Home | Next |
LINK.type | Up | LinkArray.length |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |