Created
April 26, 2012 19:17
-
-
Save wihodges/2502199 to your computer and use it in GitHub Desktop.
Append all urls with current page URL parameters - JS
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
$(document).ready(function(){ | |
elements = $('.openURL'); | |
passMe = window.location.href.slice(window.location.href.indexOf('?')); | |
elements.each(function() { | |
url = $(this).attr("href"); | |
newURL = url + passMe; | |
$(this).attr("href", newURL); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment