jquery Programming Glossary: links.length
Disabling browser tooltips on links and <abbr>s http://stackoverflow.com/questions/457366/disabling-browser-tooltips-on-links-and-abbrs var links document.getElementsByTagName 'a' for var i 0 i links.length i if links i .className 'suppress' links i ._title links i .title..
Insert link in contenteditable element http://stackoverflow.com/questions/5605401/insert-link-in-contenteditable-element 1 function el return el.nodeName.toLowerCase a alert links.length ... or something like the following function getLinksInSelection.. links containerEl.getElementsByTagName a for var i 0 i links.length i linkRange.selectNodeContents links i if linkRange.compareBoundaryPoints.. a linkRange document.body.createTextRange for var i 0 i links.length i linkRange.moveToElementText links i if linkRange.compareEndPoints..
Selecting elements without jQuery http://stackoverflow.com/questions/7266631/selecting-elements-without-jquery 'a' var result var linkcount links.length for var i 0 i linkcount i if links i .getAttribute 'title' 'some..
How to hide a row of table (or a list item) and update the datastore without reloading the page? http://stackoverflow.com/questions/7669256/how-to-hide-a-row-of-table-or-a-list-item-and-update-the-datastore-without-rel match hide var re hide i For each link... for var i 0 iLen links.length i iLen i Use a variable for the current link a bit more efficient..
JavaScript: Adding an onClick handler without overwriting the existing one http://stackoverflow.com/questions/891989/javascript-adding-an-onclick-handler-without-overwriting-the-existing-one var links document.getElementsByTagName 'a' for i 0 i links.length i links i .onclick function e do some work return true But.. var links document.getElementsByTagName 'a' for i 0 i links.length i var oldOnClick links i .onclick links i .onclick function.. var links document.getElementsByTagName 'a' for i 0 i links.length i links i .onclick function var origOnClick links i .onclick..
jQueryUI Autocomplete - how to match search words with a list of keywords and show the matched results? http://stackoverflow.com/questions/9040137/jqueryui-autocomplete-how-to-match-search-words-with-a-list-of-keywords-and-sh function request response var matched var numOfLinks links.length Get entered search terms request.term from user and search through.. request.term through all links keywords for var k 0 k links.length k if checkSearchWordsMatchKeywords request.term links k 'keywords'..
Disabling browser tooltips on links and <abbr>s http://stackoverflow.com/questions/457366/disabling-browser-tooltips-on-links-and-abbrs tooltip display for links that have the classname 'suppress' var links document.getElementsByTagName 'a' for var i 0 i links.length i if links i .className 'suppress' links i ._title links i .title links i .onmouseover function this.title '' links i..
Insert link in contenteditable element http://stackoverflow.com/questions/5605401/insert-link-in-contenteditable-element if sel.rangeCount var links sel.getRangeAt 0 .getNodes 1 function el return el.nodeName.toLowerCase a alert links.length ... or something like the following function getLinksInSelection var selectedLinks var range containerEl links linkRange.. a selectedLinks.push containerEl else links containerEl.getElementsByTagName a for var i 0 i links.length i linkRange.selectNodeContents links i if linkRange.compareBoundaryPoints range.END_TO_START range 1 linkRange.compareBoundaryPoints.. containerEl else links containerEl.getElementsByTagName a linkRange document.body.createTextRange for var i 0 i links.length i linkRange.moveToElementText links i if linkRange.compareEndPoints StartToEnd range 1 linkRange.compareEndPoints EndToStart..
Selecting elements without jQuery http://stackoverflow.com/questions/7266631/selecting-elements-without-jquery ™s the most effective but at least it works. var links top.document.getElementsByTagName 'a' var result var linkcount links.length for var i 0 i linkcount i if links i .getAttribute 'title' 'some title text here' result.push links i share improve this..
How to hide a row of table (or a list item) and update the datastore without reloading the page? http://stackoverflow.com/questions/7669256/how-to-hide-a-row-of-table-or-a-list-item-and-update-the-datastore-without-rel var link links document.links A regular expression to match hide var re hide i For each link... for var i 0 iLen links.length i iLen i Use a variable for the current link a bit more efficient link links i If the link contains the text hide add on..
JavaScript: Adding an onClick handler without overwriting the existing one http://stackoverflow.com/questions/891989/javascript-adding-an-onclick-handler-without-overwriting-the-existing-one approach might be something like this function adaptLinks var links document.getElementsByTagName 'a' for i 0 i links.length i links i .onclick function e do some work return true But some of the links already have an onClick handler that should.. should be preserved. I tried the following function adaptLinks var links document.getElementsByTagName 'a' for i 0 i links.length i var oldOnClick links i .onclick links i .onclick function e if oldOnClick null oldOnClick return false do some work return.. true There a script type text javascript function adaptLinks var links document.getElementsByTagName 'a' for i 0 i links.length i links i .onclick function var origOnClick links i .onclick return function e if origOnClick null origOnClick return..
jQueryUI Autocomplete - how to match search words with a list of keywords and show the matched results? http://stackoverflow.com/questions/9040137/jqueryui-autocomplete-how-to-match-search-words-with-a-list-of-keywords-and-sh create ' '#searchTerms' .autocomplete minLength 2 source function request response var matched var numOfLinks links.length Get entered search terms request.term from user and search through all links keywords for var k 0 k numOfLinks k If it.. ... source function request response var matched Search request.term through all links keywords for var k 0 k links.length k if checkSearchWordsMatchKeywords request.term links k 'keywords' matched.push links k display the filtered results..
|