Archive for December, 2007

Web server address - N NamedNodeMap.removeNamedItem() (Method) NamedNodeMap.removeNamedItem() (Method) Given that

Monday, December 31st, 2007

N NamedNodeMap.removeNamedItem() (Method) NamedNodeMap.removeNamedItem() (Method) Given that you know the name of an item, you can locate and remove it from the collection. If necessary, the item is replaced by another containing the default attribute settings. Availability: Property/method value type: JavaScript syntax: Argument list: The value returned is a reference to the node that was removed. The same rules used for the getNamedItem() method apply. If no item is found then a null is returned instead. Multiple matching nodes may result in unpredictable and implementation-specific results. If this node is not referred to by any other means and you do not assign the value to a variable, then the node will become detached and no longer has an owner. You will have no way to locate that node again without reconstructing the document. The object representing the node should in due course be garbage-collected automatically. NamedNodeMap.setNamedItem() (Method) A node is added to the collection having the specified node name. Any node already present with that name will be replaced. Availability: DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Node object -myNamedNodeMap.removeNamedItem(aName) aName An associative array reference DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Node object -myNamedNodeMap.setNamedItem(aNode) aNode The node to be set Property/method value type: JavaScript syntax: Argument list: If a replacement happens, the old node that occupied the same position in the document and which was displaced by the new node will be returned as a result of this method call. If you need to access that node again, you must make sure a reference to it is retained otherwise you will need to reconstruct the document from scratch to manufacture another. 1481

JavaScript Programmer’s Reference NamedNodeMap.item() (Method) The usual collection (Personal web server)

Sunday, December 30th, 2007

JavaScript Programmer’s Reference NamedNodeMap.item() (Method) The usual collection access by item number also applies to named node maps. A reference to an element in a collection This accesses nodes by their position in the linear sequence of nodes within the map. The index value is zero-based so if the value specified is equal to or greater than the number of nodes in the map, a null value will be returned instead. Warnings: . Note that the item() method for a NamedNodeMap is spelled with a lower case i. The MSIE Collection class also has an Item() method that provides similar (but not identical) ways of accessing items in a collection. Note that Collection.Item() is spelled with a capital I. Availability: DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Property/method value type: Node object JavaScript syntax: -myNamedNodeMap.item(anIndex) Argument list: anIndex See also: Collection.Item() NamedNodeMap.length (Property) The number of members in the named node map is returned by this property. Availability: DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Property/method value type: Number primitive JavaScript syntax: -myNamedNodeMap.length This is zero-based length of the NamedNodeMap collection/array. It allows you to enumerate through the collection with a for(…)loop, visiting each node in turn. 1480

N NamedNodeMap.getNamedItem() (Method) DOM (Free web hosting music) 2 standardization is

Sunday, December 30th, 2007

N NamedNodeMap.getNamedItem() (Method) DOM 2 standardization is not quite stable and no browsers support it yet. At this time, browsers have reached DOM level 1 capabilities and we can expect support for these namespace extensions in the next round of browser upgrades. See also: Collection object, DOM, DOM Level 1, Node object, Node.attributes[], NodeList object Property JavaScript JScript N IE Opera DOM Notes length 1.5 + 5.0 + 6.0 + 5.0 + 1 + - Method JavaScript JScript N IE Opera DOM Notes getNamedItem() 1.5 + 5.0 + 6.0 + 5.0 + 1 + - item() 1.5 + 5.0 + 6.0 + 5.0 + 1 + Warning removeNamedItem() 1.5 + 5.0 + 6.0 + 5.0 + 1 + - setNamedItem() 1.5 + 5.0 + 6.0 + 5.0 + 1 + - Inheritance chain: Array Object Web-references: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1074577549 NamedNodeMap.getNamedItem() (Method) Given the name of a node, it can be extracted from the collection by name. Availability: Property/method value type: JavaScript syntax: Argument list: If a node having the specified name exists in the node map, the a reference to it will be returned. If there is no matching node, a null will be returned instead. It isn’t clear what happens if there are duplicate nodes with the same name. Some implementations may choose to return a collection of all nodes with a matching name. DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Node object -myNamedNodeMap.getNamedItem(aName) aName The name of the node to be accessed 1479

JavaScript Programmer’s Reference NAME=”…” (HTML Tag (Photography web hosting) Attribute) An

Saturday, December 29th, 2007

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(),

name (Property) An alias (Free web hosts) for the window.name property.

Friday, December 28th, 2007

name (Property) An alias for the window.name property. Availability: DOM level 1 JavaScript 1.0 JScript 1.0 Internet Explorer 3.02 Netscape 2.0 Opera 3.0 Property/method value type: String primitive -nameJavaScript syntax: -myWindow.name HTML syntax: Window.open(…) aName A name for the window aString A string value containing the new name for the window Argument list: aURL A URL to load into the window Refer to: Window.name

Web site layout - JavaScript Programmer’s Reference See also: MutationEvent.attrChange, MutationEvent.attrName, MutationEvent.prevValue

Thursday, December 27th, 2007

JavaScript Programmer’s Reference See also: MutationEvent.attrChange, MutationEvent.attrName, MutationEvent.prevValue Property attributes: ReadOnly. MutationEvent.prevValue (Property) When an attribute changes, the old attribute value is available here. DOM level 2 JavaScript 1.5 Netscape 6.0 Availability: Property/method value type: JavaScript syntax: String primitive myMutationEvent.prevValue N This value preserves the old attribute value so you can restore it into the attribute if you inspect the new value and find that it is inappropriate. See also: MutationEvent.attrChange, MutationEvent.attrName, MutationEvent.newValue Property attributes: ReadOnly. MutationEvent.relatedNode (Property) A Node object is referred to here which can be used to perform contextual examination of the event. DOM level 2 JavaScript 1.5 Netscape 6.0 Node object myMutationEvent.relatedNode N Availability: Property/method value type: JavaScript syntax: For attribute changes, this should contain a reference to the node that owned the attribute that was changed. Other operations such as node addition or removal may contain parent nodes or indeed the node that has just been added during an insertion. See also: Node object, Node.parentNode Property attributes: ReadOnly. 1476

Web server version - M MutationEvent.initMutationEvent() (Method) MutationEvent.initMutationEvent() (Method) After creating

Thursday, December 27th, 2007

M MutationEvent.initMutationEvent() (Method) MutationEvent.initMutationEvent() (Method) After creating a MutationEventobject, it must be initialized with this method call. DOM level 2 JavaScript 1.5 Netscape 6.0 Availability: JavaScript syntax: N myMutationEvent.initMutationEvent(aType, aBubble, aCancel, aNode, aPrev, aNew, aName) aType A string containing the event type aBubble A boolean value indicating whether the event can bubble aCancel A boolean value indicating whether the event can be cancelled aNode A reference to a related Node object aPrev A string containing the previous value aNew A string containing the new value Argument list: aName A string containing the name of an attribute A new event object is manufactured by calling the DocumentEvent.createEvent() method. That event should have been defined with a type specified as “MutationEvent”. If it was, then it will support an initMutationEvent()method. This must be called before the event is dispatched otherwise the event object will not contain enough information for the event dispatcher/handler to make sense of it and route it to the correct target objects. Two boolean argument values define whether the event will be allowed to be cancelled and what type of propagation to use (bubbleor capture). You can add a reference to a related node and can also define previous and new values if you are simulating an attribute change. Finally for an attribute change, the attribute name can be specified. See also: Event.target, EventTarget object, Node object MutationEvent.newValue (Property) When an attribute changes, the new attribute value is available here. DOM level 2 JavaScript 1.5 Netscape 6.0 Availability: Property/method value type: JavaScript syntax: String primitive myMutationEvent.newValue N You can use this value to check that the new attribute value is appropriate and if necessary modify it to ensure it falls within your require range. You can compare it with the previous value if need be. 1475

Free web host - JavaScript Programmer’s Reference This value is meaningful for

Wednesday, December 26th, 2007

JavaScript Programmer’s Reference This value is meaningful for DOMAttrModified events. The MutationEvent class provides the following constant values for testing attribute change property values: Value Symbolic name 1 MODIFICATION 2 ADDITION 3 REMOVAL See also: Attribute object, MutationEvent.newValue, MutationEvent.prevValue, Node.attributes[] Property attributes: ReadOnly. MutationEvent.attrName (Property) The name of a node attribute that has changed for a DOMAttrChange event. DOM level 2 JavaScript 1.5 Netscape 6.0 Availability: Property/method value type: JavaScript syntax: String primitive myMutationEvent.attrName N This is a string value containing the name of an attribute that has been changed. The old and new values are available in the prevValue and newValueproperties of the MutationEvent if you need to inspect them. See also: Attribute object, MutationEvent.newValue, MutationEvent.prevValue, Node.attributes[] Property attributes: ReadOnly. 1474

M MutationEvent.attrChange (Property) A (Web hosting comparison) cascading effect is

Tuesday, December 25th, 2007

M MutationEvent.attrChange (Property) A cascading effect is very likely with a single DOM tree change causing a number of subsequent mutation events to be fired as lower portions of the tree are affected. The standard does not mandate any particular ordering of these events and leaves it to the implementation to control the sequence. This suggests that the cascaded mutations may occur in a different sequence depending on the browser. You should therefore design your event handler so that it can be called in a re-entrant and random orders and that there should be no dependency on things being traversed in a predictable sequence. DOM, DOM Level 2, DOM Events, Event management, Event model, Event-driven model, EventListener object, EventTarget.addEventListener(), Implementation.hasFeature() See also: Property JavaScript JScript N IE Opera DOM Notes attrChange 1.5 + 6.0 + 2 + ReadOnly attrName 1.5 + 6.0 + 2 + ReadOnly bubbles 1.5 + 6.0 + 2 + - cancelable 1.5 + 6.0 + 2 + - currentTarget 1.5 + 6.0 + 2 + - eventPhase 1.5 + 6.0 + 2 + - newValue 1.5 + 6.0 + 2 + ReadOnly prevValue 1.5 + 6.0 + 2 + ReadOnly relatedNode 1.5 + 6.0 + 2 + ReadOnly target 1.5 + 6.0 + 2 + - timeStamp 1.5 + 6.0 + 2 + - type 1.5 + 6.0 + 2 + - Method JavaScript JScript N IE Opera DOM Notes initEvent() 1.5 + 6.0 + 2 + - initMutationEvent() 1.5 + 6.0 + 2 + - preventDefault() 1.5 + 6.0 + 2 + - stopPropagation() 1.5 + 6.0 + 2 + - MutationEvent.attrChange (Property) The value in this property describes the kind of change that has taken place when the mutation event was an attribute change. Availability: DOM level 2 JavaScript 1.5 Netscape 6.0 Property/method value type: Number primitive JavaScript syntax: N myMutationEvent.attrChange 1473

JavaScript Programmer’s Reference MutationEvent object (Object/DOM) A notification (Remote web server)

Monday, December 24th, 2007

JavaScript Programmer’s Reference MutationEvent object (Object/DOM) A notification that the document content has changed should trigger a mutation event which is described in one of these objects. Availability: DOM level 2 JavaScript 1.5 Netscape 6.0 JavaScript syntax: N myMutationEvent = new MutationEvent() Object properties: attrChange, attrName, bubbles, cancelable, currentTarget, eventPhase, newValue, prevValue, relatedNode, target, timeStamp, type Class constants: ADDITION, MODIFICATION, REMOVAL Object methods: stopPropagation() initEvent(), initMutationEvent(), preventDefault(), The availability of the MutationEventobject handling can be determined with the Implementation.hasFeature() method call. These event types are enumerated in the DOM level 2 specification and are: . DOMSubtreeModified . DOMNodeInserted . DOMNodeRemoved . DOMNodeRemovedFromDocument . DOMNodeInsertedIntoDocument . DOMAttrModified . DOMCharacterDataModified The DOM level 2 event module specification doesn’t describe the binding of these events to event handlers so although this event model is implemented in Netscape 6.0, you may need to explore the event naming conventions to make effective use of it. Taking the event names and placing the ‘on’ prefix in front of them and using that as a property name to which you can attach a handler function may work. The DOM level 2 event module also provides an EventListener registration which allows you to register event types with EventTarget objects, using the addEventListener() method. The contextual information is carried in the detail property, and when it is present, will usually describe a reference to a node object or an attribute value. When the document content is modified, a MutationEvent object is instantiated to carry a description of that change to the event handler. Mutation events cannot be cancelled. This is because the DOM interface would become unwieldy if the document changes were not properly completed. This may change later when the DOM standard introduces transaction handling, although the DOM level 2 event specification does not go to great lengths to explain in detail how that is likely to be implemented. 1472