Document.createDocumentFragment

 

JavaScript -> Objekty -> Document -> Metóda createDocumentFragment

Syntax


var docFragment = document.createDocumentFragment();

Popis


Príkaz jazyka JavaScript
Creates an empty document fragment.
docFragment is a reference to an empty DocumentFragment object.

A DocumentFragment is a minimal document object that has no parent. It supports the following DOM 2 methods: appendChild, cloneNode, hasAttributes, hasChildNodes, insertBefore, normalize, removeChild, replaceChild.

It also supports the following DOM 2 properties: attributes, childNodes, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, textContent.

Various other methods can take a document fragment as an argument (e.g. Node interface methods such as appendChild and insertBefore), in which case the children of the fragment are appended or inserted, not the fragment itself.

Príklad


var frag = document.createDocumentFragment();
frag.appendChild(document.createTextNode('Ipsum Lorem'));
document.body.appendChild(frag);



vytlačiť článok  hľadať súvisiace články 

Chat ku článku

Vyhľadávanie na stránke
Reklama
Náhodný obrázok
náhodný obrázok
Kontakty

Martin Kasman, M Software
Smreková 3095/23
Email: martin@kasman.sk

Telefón: 0908 270 294