Last active
August 29, 2015 14:14
-
-
Save fleimisch/4fd7c1eb89180e62e583 to your computer and use it in GitHub Desktop.
JavaScript Snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // USE either script 1 or script 2, don't combine! | |
| // SCRIPT 1: | |
| $(document).ready(function(){ | |
| $(".SearchResultsTop .Left span").html(function(index, text) { | |
| return text.replace('items matching your criteria', 'Tests matching'); | |
| }); | |
| }); | |
| // SCRIPT 2: | |
| function nativeSelector() { | |
| var elements = document.querySelectorAll("body, body *"); | |
| var results = []; | |
| var child; | |
| for(var i = 0; i < elements.length; i++) { | |
| child = elements[i].childNodes[0]; | |
| if(elements[i].hasChildNodes() && child.nodeType == 3) { | |
| results.push(child); | |
| } | |
| } | |
| return results; | |
| } | |
| var textnodes = nativeSelector(), | |
| _nv; | |
| for (var i = 0, len = textnodes.length; i<len; i++){ | |
| _nv = textnodes[i].nodeValue; | |
| textnodes[i].nodeValue = _nv.replace(/S\/./g,'TZS'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment