【发布时间】:2014-02-28 22:55:36
【问题描述】:
这可能真的很简单,但我似乎找不到解决方案。我正在进行 AJAX 调用,成功后我将重定向到不同的页面。这行得通。
我想要:重定向 > 在新页面上向用户显示消息
我明白了:在当前页面上向用户显示消息 > 重定向
代码:
$('#delete').click(function() {
$.ajax({
type: "POST" ,
url: delete_url ,
data: {action_id: action_id } ,
success: function(response) {
if (response.success) {
window.location = action_list
$("#success").html(response.success);
} else {
$("#error").html(response.error);
$("#success").html("");
}
}
});
return false;
});
【问题讨论】: