Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieldrasdo/80bfedf12bbc62897a80 to your computer and use it in GitHub Desktop.
Save danieldrasdo/80bfedf12bbc62897a80 to your computer and use it in GitHub Desktop.
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