laravel - ajax 查询有什么问题,没有连接和成功查询 laravel?
问题描述
我的添加到购物车 ajax 请求有问题,这不会导致我正在处理的 laravel 项目。问题是本地一切都运行良好:
async function add_cart(row_id,variant) {
$('#cover-spin').show(0);
$.ajax({
type: "get",
url: APP_URL + "/cart/add/" + row_id,
data: {quantity: 1,variants: variant},
success: function (response) {
if (response) {
$('#search-keyword').keyup();
refreshCartPage();
updateCartCount();
setTimeout(function(){ $('#cover-spin').hide(0); }, 1000);
toastr.options.closeButton = true;
toastr.success("Produit ajouter au panier");
} else {
refreshCartPage();
setTimeout(function(){ $('#cover-spin').hide(0); }, 1000);
toastr.options.closeButton = true;
toastr.error("Quelque chose c'est mal passé");
}
},
error: function (response) {
refreshCartPage();
setTimeout(function(){ $('#cover-spin').hide(0); }, 1000);
}
});
}
这是有问题的shoppypagne网站的链接。
你知道如何解决这个问题吗?
提前致谢。:)
解决方案
推荐阅读
- python - 使用公共外键在一个查询中加入 2 个类
- python - 运行回测和购买时,我总是收到订单取消/保证金/拒绝
- c - 将二维数组的每个元素乘以 5 (C/C++)
- c# - 在 NuGet 包中包含一个文件夹并将其作为文件 .netcore/Razor 安装到项目中
- r - 使用 tidyverse 环境循环遍历数据帧,比较结果,并返回一个值。类似于excel中的vlookup功能
- python - 使用matplotlib改变python中x轴和y轴之间的角度
- spring-mvc - 在 Heroku 上部署 Spring MVC
- regex - 在 HTML 中替换品牌的正则表达式
- c# - Dropzone文件上传
- html - 条件语句在 html 文件中不起作用