$("#follow-button,.followTopic,.followerUser").click(function(){
if(!check_login()){
return ;
}
$(this).button('loading');
var follow_btn = $(this);
var source_type = $(this).data('source_type');
var source_id = $(this).data('source_id');
var show_num = $(this).data('show_num');
$.get('/follow/'+source_type+'/'+source_id,function(msg){
follow_btn.removeClass('disabled');
follow_btn.removeAttr('disabled');
if(msg =='followed'){
follow_btn.html('已关注');
follow_btn.addClass('active');
}else{
follow_btn.html('关注');
follow_btn.removeClass('active');
}
/*是否操作关注数*/
if(Boolean(show_num)){
var follower_num = $("#follower-num").html();
if(msg==='followed'){
$("#follower-num").html(parseInt(follower_num)+1);
}else{
$("#follower-num").html(parseInt(follower_num)-1);
}
}
});
});
当网站放在文件夹下时,这里的相对地址造成404错误