$(function() {
$("-sharpremove_favorite_btn").click(function (e){
e.preventDefault();
$.ajax({
type: "GET",
url: ,
success: function(data){
$("-sharpremove_favorite_btn").attr("id", "add_favorite_btn");
}
});
});
$("-sharpadd_favorite_btn").click(function (e){
e.preventDefault();
$.ajax({
type: "GET",
url: ,
success: function(data){
$("-sharpadd_favorite_btn").attr("id", "remove_favorite_btn");
}
});
});
});
are all in the same interview
after add_favorite_btn click, I successfully changed the id property of add_favorite_btn to remove_favorite_btn
. At this time, I was pressing it, according to my idea, I could start remove_favorite_btn event
directly, but it turned out that he was still engaged in add_favorite_btn activities instead of remove_favorite_btn
. How could this happen?