Just as a Link object represents a hypertext link, an Anchor object represents a named location within a document which can serve as the target of a hypertext link. Anchors are something like the reverse of Links, and they are treated similarly to Links in HTML and in JavaScript. An anchor is created with the <A> tag, when it is used with the NAME attribute (rather than the HREF attribute, which creates a link). The Document object contains an anchors[] property which is an array of all the Anchors in the document.
There is only one flaw in this analogy between links and anchors: the Anchor object has not been implemented in either JavaScript 1.0 or JavaScript 1.1. So, in Navigator 2.0, Navigator 3.0, and Internet Explorer 3.0, the anchors[] property of the Document object is an array that contains null for each of its elements. The length property of the anchors[] array does work, and you can use it to determine the number of anchors in a given document, although this information may not be of particular use.
The next version of JavaScript will likely contain a useful implementation of the Anchor object.
file: /Techref/language/JAVA/SCRIPT/definitive/ch14_03.htm, 4KB, , updated: 2019/10/14 15:00, local time: 2024/11/19 17:44,
3.138.178.7:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://linistepper.com/Techref/language/JAVA/SCRIPT/definitive/ch14_03.htm"> [Chapter 14] 14.3 The Anchor Object</A> |
Did you find what you needed? |