I'm using jquery to bind some click events on a link. Using, the following code I have been able to change the link's href via ajax - but when the href changes and I try to click the link, nothing happens.
Wondering if anyone can spot an obvious error that I am missing.
$('a.shortlist_action').bind('click',function(){
item = $(this);
href = item.attr('href');
parent = $(this).parent('.shortlist_action_container');
item = $(this);
$.ajax({
url: $(this).attr('href'),
success: function(data) {
item.addClass('largeviewplannerbutton');
item.attr("href", '/myaccount/planner');
}
}
});
// stop event propagation here
return false;
});
Thank you.