Created
February 2, 2015 18:50
-
-
Save philbar/f160a32e6f4d6e47f9b9 to your computer and use it in GitHub Desktop.
Append URL Params to Links
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
<script> | |
$(document).ready(function() { | |
var params = window.location.search.replace(/ /g,'%20'); | |
var textLink = $('.lp-pom-text a').each( function(i) { | |
if(this.href.indexOf('?') !== -1){ | |
this.href = this.href + params.replace("?", "");; | |
} | |
else { | |
this.href = this.href + params; | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment