JavaScript Programmer’s Reference NAME=”…” (HTML Tag Attribute) An HTML tag attribute that names an object. Many objects are identified in the DOM hierarchy of the web browser by means of their name property. This value is defined as an HTML tag attribute. Some objects can be accessed using an ID=”…” HTML tag attribute instead of, or as well as, the NAME=”…” HTML tag attribute. With browsers converging on the DOM specification and its Nodal structure, the NAME=”…”HTML tag attribute is expected to become deprecated in favor of the ID=”…” attribute. See also: Anchor.name, Document.
, ID=”…”, Object.name, OBJECT.name, Plugin.name, Window.name NamedNodeMap object (Object/DOM) Where nodes have a nameattribute, they can be presented as members of a NamedNodeMap collection object. setNamedItem() A NamedNodeMap is a collection of nodes that can be accessed by name. It does not inherit from NodeList, and the DOM does not mandate any parentage. It will probably inherit from Collection or Array but this appears to be implementation dependant. A general purpose Dictionary class would be helpful as a starting point but these are not available in all implementations. The nodes are not collated in any particular order and you can access them with a numeric index as well as by associative name. This implies a namespacing issue and clearly there may be problems with your document if nodes share the same name and need to be collected into a NamedNodeList entity. The DOM level 2 specification provides these new methods to cope with namespaces: . getNamedItemNS() . setNamedItemNS() . removeNamedItemNS() 1478 Availability: DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Inherits from: Array object JavaScript syntax: -myNamedNodeMap = new NamedNodeMap() Object properties: length Object methods: getNamedItem(), item(), removeNamedItem(),
This entry was posted
on Saturday, December 29th, 2007 at 7:16 am and is filed under Tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.