当我点击带有JQuery
的按钮时,它会发送Ajax
帖子,然后返回返回数据中的位置。但是,当位置已经使用window.location.href
刷新一次后,我再次点击该按钮,window.location.href
将无效,但数据会正确返回。
有什么想法吗?
JQuery的:
$(document).on("click", ".remove_pupil_quad_blog_member", function(){
var member_id = $(this).attr("id").replace("remove_member_", "");
var group_id = $("input[name='pupil_quad_group_id']").val();
$.post("/ajax/admin/school.design.ajax.php", {cmd:'remove_pupil_quad_blog_member', group_id: group_id, member_id: member_id, dataType: 'json'}, function(data){
var JSON_Message = JSON.parse(data);
console.log(JSON_Message.new_location);
window.location.href = JSON_Message.new_location;
});
});