Created
March 7, 2016 18:08
-
-
Save danieldrasdo/80bfedf12bbc62897a80 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
var linkMap = { | |
"%%h1_link%%" : "http://www.brighton.com/?h1", | |
"%%h2_link%%" : "http://www.brighton.com/?h2", | |
"%%s1_link%%" : "http://www.brighton.com/?s1", | |
"%%s2_link%%" : "http://www.brighton.com/?s2" | |
}; | |
$("body").text(function(index, originalText) { | |
for ( var link in linkMap ) { | |
if (originalText.indexOf(link) > -1) { | |
return originalText.replace(link, linkMap[link]); | |
} | |
} | |
return originalText; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment