How can I change the URL parameter of an ajax link after the ajax has successfully executed? The following code doesn't work, but explains what I want to do.
CHtml::ajaxLink($text, array('/core/bookmark/create'), array(
'data' => array("id" => $id),
'type' => 'GET',
'success'=>'js:function(data){
if (data.status == "success"){
//attempt to dynamically change the URL
this.url = "/core/bookmark/delete";
$("#bookmark-btn").toggleClass("bookmark_on").toggleClass("bookmark_off");
}
}',
), array('id'=>'bookmark-btn', 'class' => 'bookmark_off'));
the line with this.url
makes no effect on the ajaxLink's URL, but it doesn't throw any errors in the console either.