[jQuery] replace href with affiliate id
I've been trying this a few different ways and have been unable to
replace a regular link with a link that includes my affiliate ID.
Here's the function which I call to replace the links, and the alert
does show the correct updated link
[code]
function updateTix(){
$('.tix a').each(function(event){
var tixLink = $(this).attr('href');
var affilLink = 'http://www.stubhub.com/'+tixLink+'?
ticket_finder='+affil;
alert(affilLink);
$(this).attr('href').replace(tixLink, affilLink);
});
[/code]
I've tried the following to replace the href, but non are working...
[code]
$(this).attr('href').replace(tixLink, affilLink);
$(this).attr('href').replace(affilLink);
$(this).attr('href', affilLink);
this.href=affilLink;
[/code]
any ideas on this?