¡@

Home 

javascript Programming Glossary: frag

jquery: fastest DOM insertion?

http://stackoverflow.com/questions/117665/jquery-fastest-dom-insertion

new content . You can avoid this by appending a document fragment onto mydiv instead var frag document.createDocumentFragment.. by appending a document fragment onto mydiv instead var frag document.createDocumentFragment frag.innerHTML html #mydiv .append.. mydiv instead var frag document.createDocumentFragment frag.innerHTML html #mydiv .append frag In this way only your new..

Javascript Regex to replace text NOT in html attributes [duplicate]

http://stackoverflow.com/questions/5904914/javascript-regex-to-replace-text-not-in-html-attributes

looking to do this client side you can create a document fragment and or disconnected DOM node neither of which is displayed.. value' form p class 'testing test' Testing here too p var frag document.createDocumentFragment var body document.createElement.. body Insert the result into the current document via a fragment node body.firstChild while node next node.nextSibling frag.appendChild..

Insert html at caret in a contenteditable div

http://stackoverflow.com/questions/6690752/insert-html-at-caret-in-a-contenteditable-div

var el document.createElement div el.innerHTML html var frag document.createDocumentFragment node lastNode while node el.firstChild.. node lastNode while node el.firstChild lastNode frag.appendChild node range.insertNode frag Preserve the selection.. lastNode frag.appendChild node range.insertNode frag Preserve the selection if lastNode range range.cloneRange..

Can I load an entire HTML document into a document fragment in Internet Explorer?

http://stackoverflow.com/questions/7474710/can-i-load-an-entire-html-document-into-a-document-fragment-in-internet-explorer

I load an entire HTML document into a document fragment in Internet Explorer Here's something I've been having.. in the variable html here's what I've tried so far var frag document.createDocumentFragment div frag.appendChild document.createElement.. tried so far var frag document.createDocumentFragment div frag.appendChild document.createElement div div.outerHTML html results..

Ways to increase performance when set big value to innerHTML

http://stackoverflow.com/questions/788614/ways-to-increase-performance-when-set-big-value-to-innerhtml

HTML callback var temp document.createElement 'div' frag document.createDocumentFragment temp.innerHTML HTML function.. temp.innerHTML HTML function if temp.firstChild frag.appendChild temp.firstChild setTimeout arguments.callee 0 else.. setTimeout arguments.callee 0 else callback frag Using it var allTheHTML ' div a href # ............. div '..

Inserting HTML elements with JavaScript

http://stackoverflow.com/questions/814564/inserting-html-elements-with-javascript

messing with innerHTML it might be better to create a fragment and then insert that function create htmlStr var frag document.createDocumentFragment.. fragment and then insert that function create htmlStr var frag document.createDocumentFragment temp document.createElement.. 'div' temp.innerHTML htmlStr while temp.firstChild frag.appendChild temp.firstChild return frag var fragment create..

Inserting arbitrary HTML into a DocumentFragment

http://stackoverflow.com/questions/9284117/inserting-arbitrary-html-into-a-documentfragment

DocumentFragment I know that adding innerHTML to document fragments has been recently discussed and will hopefully see inclusion.. That is take var html ' div x div span y span ' var frag document.createDocumentFragment I want both the div and the.. I want both the div and the span inside of frag with an easy one liner. Bonus points for no loops. jQuery is..