$.post(url, JSON.stringify(send_data), function(data, ts){},'json'); window.location.href = "http://" + localStorage.ServerIP;點擊退出按鈕以后向后端發送send_data,然后跳轉到ServerIP在chrome下后端可以收到send_data,但是Firefox下不能收到只有把post設為同步,Firefox才能收到send_data請問下有沒有什么好的方法(除了設置同步),讓前端發送完send_data以后再進行跳轉? $.ajax({ type:"post",
url:url, async:false,
data:JSON.stringify(send_data),
dataType:"json",
success:function(data){
}
});改用這種格式就能成功跳轉+發送數據,這是為啥?
1 回答

慕沐林林
TA貢獻2016條經驗 獲得超9個贊
success:function(data){ window.location.href = "http://" + localStorage.ServerIP; }
- 1 回答
- 0 關注
- 757 瀏覽
添加回答
舉報
0/150
提交
取消