Forked from StabbyMcDuck/gist:ea78f9edd2b113a4a30204ee7c928949
Last active
May 31, 2018 19:05
-
-
Save KronicDeth/49909c61b594d4ec108f57fdd86d35f1 to your computer and use it in GitHub Desktop.
This file contains 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
function insertHREFs() { | |
// get all anchor tags | |
// THIS WORSK IN IE OR CHROME | |
var navControlLinks = document.querySelectorAll('a[data-nav-control-id]'); | |
for(var i=0; i < navControlLinks.length; i++) { | |
var element = navControlLinks[i]; | |
var dataNavControlId = element.getAttribute('data-nav-control-id'); | |
var value = obj.get(dataNavControlId); | |
concatenateURL(element, value); | |
} | |
/* | |
// THIS WORKS IN CHROME | |
document.querySelectorAll('a[data-nav-control-id]').forEach(function(element) { | |
var dataNav = element.getAttribute('data-nav-control-id'); | |
var value = obj.get(dataNav); | |
concatenateURL(element, value); | |
}); */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment