3

Masking Affiliate Links With jQuery

You can mask affiliate links using this so that the url appears to be different than what it actually is.


$(function(){
	$('a.affLink').mouseover(function(){
		window.status=this.title;
		return true;
	}).mouseout(function(){
		window.status='Done';return true;
	});
});
Levels: Syntax:

User Comments

( ADD YOURS )

  1. This looks to be a very useful function, but it's not clear how one would use it to hide links. Would have to give each link a class of "afflink" when inserting into a post/page?


  2. Yeah, you could do a few other things though if you added some code to this. For example use a regex to find urls that have a certain domain, or query string in them, then use this snippet on those urls.


  3. Very cool, thanks for the clarification and additional options. Most appreciated:)

Trackbacks


  1. Avatar

    Your Name
    May 17


    CommentLuv badge