Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Swal不';未显示,但已传递数据_Javascript_Php_Html_Laravel 5.2_Sweetalert - Fatal编程技术网

Javascript Swal不';未显示,但已传递数据

Javascript Swal不';未显示,但已传递数据,javascript,php,html,laravel-5.2,sweetalert,Javascript,Php,Html,Laravel 5.2,Sweetalert,我试图在传递数据时显示swal成功消息。即使数据被传递,我也没有得到swal,这显示在chrome控制台上 未捕获引用错误:未定义swal 成功@CustomerRoyalty:40 (匿名函数)@CustomerLoyalty:217 第40行: <script> function alerts() { swal({ title: "Are you sure you want to delete?", text: "You will not

我试图在传递数据时显示swal成功消息。即使数据被传递,我也没有得到swal,这显示在chrome控制台上

未捕获引用错误:未定义swal 成功@CustomerRoyalty:40 (匿名函数)@CustomerLoyalty:217

第40行:

    <script>
    function alerts() {
        swal({   title: "Are you sure you want to delete?",   text: "You will not be able to recover this record!",   type: "warning",   showCancelButton: true,   confirmButtonColor: "#DD6B55",   confirmButtonText: "Delete",   closeOnConfirm: false }, function(){   swal("Deleted!", "Employee Record has been deleted", "success"); });
    }

    function success() {
        swal("Warning!","Failed to record leave!", "success")
    }
</script>

函数警报(){
swal({title:“您确定要删除吗?”,文本:“您将无法恢复此记录!”,键入:“警告”,showCancelButton:true,confirButtonColor:“#DD6B55”,confirButtonCext:“删除”,closeOnConfig:false},function(){swal(“已删除!”,“员工记录已删除”,“成功”);});
}
函数成功(){
swal(“警告!”,“记录休假失败!”,“成功”)
}
上面是我的swal函数,当我单击控制台中的错误时,“swal(“警告!”、“记录离开失败!”、“成功”)”用红色下划线。(见截图)

第217行:

 <form role="form" method="POST" action="http://localhost:8000/CustomerLoyalty">
                                                   <script type="text/javascript">success();</script>

成功();

有人能告诉我这里出了什么问题吗?我已经在我的标题中粘贴了swal链接。

如果
swal
本身显示为
undefined
,那么swal脚本将无法加载。加载时检查网络选项卡,查看是否加载了swal js。

如果
swal
本身显示为
undefined
,则swal脚本根本无法加载。加载时检查网络选项卡,查看是否加载了swal js。

SOLVEDIT

<script>
function alerts() {
    swal({   title: "Are you sure you want to delete?",   text: "You will not be able to recover this record!",   type: "warning",   showCancelButton: true,   confirmButtonColor: "#DD6B55",   confirmButtonText: "Delete",   closeOnConfirm: false }, function(){   swal("Deleted!", "Employee Record has been deleted", "success"); });
}

函数警报(){
swal({title:“您确定要删除吗?”,文本:“您将无法恢复此记录!”,键入:“警告”,showCancelButton:true,confirButtonColor:“#DD6B55”,confirButtonCext:“删除”,closeOnConfig:false},function(){swal(“已删除!”,“员工记录已删除”,“成功”);});
}


函数成功(){
swal(“警告!”、“记录休假失败!”、“成功”);
}

SOLVEDIT

<script>
function alerts() {
    swal({   title: "Are you sure you want to delete?",   text: "You will not be able to recover this record!",   type: "warning",   showCancelButton: true,   confirmButtonColor: "#DD6B55",   confirmButtonText: "Delete",   closeOnConfirm: false }, function(){   swal("Deleted!", "Employee Record has been deleted", "success"); });
}

函数警报(){
swal({title:“您确定要删除吗?”,文本:“您将无法恢复此记录!”,键入:“警告”,showCancelButton:true,confirButtonColor:“#DD6B55”,confirButtonCext:“删除”,closeOnConfig:false},function(){swal(“已删除!”,“员工记录已删除”,“成功”);});
}


函数成功(){
swal(“警告!”、“记录休假失败!”、“成功”);
}