jquery Programming Glossary: child.nodetype
How can I use jQuery to style /parts/ of all instances of a specific word? http://stackoverflow.com/questions/1501007/how-can-i-use-jquery-to-style-parts-of-all-instances-of-a-specific-word childi 0 var child element.childNodes childi if child.nodeType 1 findText child pattern callback else if child.nodeType 3.. child.nodeType 1 findText child pattern callback else if child.nodeType 3 var matches var match while match pattern.exec child.data..
Using jQuery to gather all text nodes from a wrapped set, separated by spaces http://stackoverflow.com/questions/2836317/using-jquery-to-gather-all-text-nodes-from-a-wrapped-set-separated-by-spaces element.firstChild child null child child.nextSibling if child.nodeType 3 texts.push child else if child.nodeType 1 collectTextNodes.. if child.nodeType 3 texts.push child else if child.nodeType 1 collectTextNodes child texts function getTextWithSpaces element..
jQuery find/replace without changing original text http://stackoverflow.com/questions/4060056/jquery-find-replace-without-changing-original-text childi 0 var child element.childNodes childi if child.nodeType 1 var tag child.tagName.toLowerCase if tag 'script' tag 'style'.. tag 'textarea' findText child pattern callback else if child.nodeType 3 var matches if typeof pattern 'string' var ix 0 while..
Get content between comments http://stackoverflow.com/questions/7594661/get-content-between-comments for var i 0 i children.length i var child children i if child.nodeType 3 child.nodeValue.trim continue if child.nodeType 8 child.nodeValue.trim.. i if child.nodeType 3 child.nodeValue.trim continue if child.nodeType 8 child.nodeValue.trim name if record record true continue.. for var i children.length 1 i 0 i var child children i if child.nodeType 8 child.nodeValue.trim name if record record true continue..
jQuery selector for an element that directly contains text? http://stackoverflow.com/questions/7896455/jquery-selector-for-an-element-that-directly-contains-text for var i 0 i n i var child element.childNodes i if child.nodeType 3 child.data.indexOf text 1 elements.push element break ..
How can I use jQuery to style /parts/ of all instances of a specific word? http://stackoverflow.com/questions/1501007/how-can-i-use-jquery-to-style-parts-of-all-instances-of-a-specific-word element pattern callback for var childi element.childNodes.length childi 0 var child element.childNodes childi if child.nodeType 1 findText child pattern callback else if child.nodeType 3 var matches var match while match pattern.exec child.data.. childi 0 var child element.childNodes childi if child.nodeType 1 findText child pattern callback else if child.nodeType 3 var matches var match while match pattern.exec child.data matches.push match for var i matches.length i 0 callback.call..
Using jQuery to gather all text nodes from a wrapped set, separated by spaces http://stackoverflow.com/questions/2836317/using-jquery-to-gather-all-text-nodes-from-a-wrapped-set-separated-by-spaces like function collectTextNodes element texts for var child element.firstChild child null child child.nextSibling if child.nodeType 3 texts.push child else if child.nodeType 1 collectTextNodes child texts function getTextWithSpaces element var texts collectTextNodes.. texts for var child element.firstChild child null child child.nextSibling if child.nodeType 3 texts.push child else if child.nodeType 1 collectTextNodes child texts function getTextWithSpaces element var texts collectTextNodes element texts for var i texts.length..
jQuery find/replace without changing original text http://stackoverflow.com/questions/4060056/jquery-find-replace-without-changing-original-text element pattern callback for var childi element.childNodes.length childi 0 var child element.childNodes childi if child.nodeType 1 var tag child.tagName.toLowerCase if tag 'script' tag 'style' tag 'textarea' findText child pattern callback else if.. var tag child.tagName.toLowerCase if tag 'script' tag 'style' tag 'textarea' findText child pattern callback else if child.nodeType 3 var matches if typeof pattern 'string' var ix 0 while true ix child.data.indexOf pattern ix if ix 1 break matches.push..
Get content between comments http://stackoverflow.com/questions/7594661/get-content-between-comments false function iterate node var children node.childNodes for var i 0 i children.length i var child children i if child.nodeType 3 child.nodeValue.trim continue if child.nodeType 8 child.nodeValue.trim name if record record true continue else break.. for var i 0 i children.length i var child children i if child.nodeType 3 child.nodeValue.trim continue if child.nodeType 8 child.nodeValue.trim name if record record true continue else break if record output outerHTML child else if child.hasChildNodes.. false function iterate node var children node.childNodes for var i children.length 1 i 0 i var child children i if child.nodeType 8 child.nodeValue.trim name if record record true continue else break if record node.removeChild child else if child.hasChildNodes..
jQuery selector for an element that directly contains text? http://stackoverflow.com/questions/7896455/jquery-selector-for-an-element-that-directly-contains-text elements function walk element var n element.childNodes.length for var i 0 i n i var child element.childNodes i if child.nodeType 3 child.data.indexOf text 1 elements.push element break for var i 0 i n i var child element.childNodes i if child.nodeType..
|