ajax - 使用 Ajax 中的语句重定向路由
问题描述
在我的方法中,我有以下路线声明
return redirect('home')->with('success', 'Request is send!');
现在,我想在我的 ajax 成功函数中有这个。目前我正在使用它并且我正确地重定向到“家”,但我的成功消息没有运行。
$.ajax({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
type: 'post',
url: '/home/grouprequest',
data: {'groupid': groupid},
success: function (result) {
window.location.replace('/home'->with('success', 'Request is send!'));
}
我必须改变什么?
解决方案
推荐阅读
- excel - 在 VBA 中定义 DLL 函数时外部过程无效
- powershell - 如何在 Powershell 中流水线化变量 cmdlet?
- spring-boot - 我应该如何配置 application.properties 以在 Spring Boot 中连接 Azure SQL 数据库?
- c - 启用了 OpenSSL LDLIBS 标志的 Makefile 给出错误
- windows - 在 Windows 下使用 libsoup & https
- python-2.7 - Osmnx: Removing sidewalk from one side of the street
- javascript - amp-carousel 广告的自定义滚动长度 [AMP-HTML]
- java - Passing user variables in a demo class through a method in a different class
- android - During crossfading MediaPlayer player pauses for while on some devices mostly on Oreo and Pie
- php - PhP foreach through class instances