リンクにいくつかのクリックイベントをバインドするためにjqueryを使用しています。次のコードを使用して、リンクのhrefをajax経由で変更できましたが、hrefが変更されてリンクをクリックしようとしても何も起こりません。
私が見逃している明らかなエラーを誰かが見つけられるかどうか疑問に思っています。
$('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;
});
ありがとうございました。