我正在使用甜蜜警报从我的网站上删除产品我想通过两个选项使用它,第一个是“确定”,第二个是“取消”但是当我点击页面上的任何地方时,它会删除并取消按钮不起作用这是我的代码 $(document).on('click', '#removeCat', function(e) { e.preventDefault(); var id = $(this).data('id'); swal({ title: "are u sure?", type: "error", confirmButtonClass: "btn-danger", confirmButtonText: "ok", cancelButtonText: "cancel", showCancelButton: true, }) .then(function() { $.ajax({ type: "post", url: "{{url('dashboard/shop/product-category/delete')}}", data: { id: id, "_token": $('#csrf-token')[0].content //pass the CSRF_TOKEN() }, success: function(data) { var url = document.location.origin + "/dashboard/shop/product-category"; location.href = url; } });});});
添加回答
举报
0/150
提交
取消