Created
May 14, 2009 03:26
-
-
Save newism/111461 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
<a href="http://expressionengine.com/forums/viewthread/108855/">Link1</a> | | |
<a href="http://expressionengine.com/">Link2</a> | | |
<a href="http://expressionengine.comindex.php/?affiliate=newism&page=/forums/viewthread/108855/">Link 3</a> | |
<a href="http://expressionengine.com">Link4</a> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
eeregexp = new RegExp("^(http://(www\.)?expressionengine\.com)"); | |
affiliateregexp = new RegExp("affiliate"); | |
affiliate = "newism"; | |
$('a').click(function() { | |
if(this.href.replace(eeregexp) && !this.href.match(affiliateregexp)) | |
{ | |
this.href = this.href.replace(eeregexp, "$1/index.php?affiliate="+affiliate+"&page="); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment