【发布时间】:2014-02-06 11:44:55
【问题描述】:
鉴于这块ajax 调用FriendsController@destroy
$.ajax({
url: '/dashboard/friends/' + id,
type: 'DELETE',
data: { src: 'show' },
success: function(response) {
}
});
删除过程完成后,我如何在FriendsController 中return Redirect::route('dashboard.friends.index')?我想这是试图将响应返回给不知道如何反应的 AJAX。
我可以window.location.href = '/dashboard/friends',但我想向视图发送一条成功消息,而我无法使用 AJAX。
【问题讨论】:
-
为什么不在success函数中闪现你的成功信息,然后等待3秒再用
window.location.href = '/dashboard/friends'重定向?