2016-09-16 12 views
1

データが渡されたときスワール成功メッセージを表示しようとしています。にもかかわらず、データは私がのSwaIを得ることはありません渡され、これはクロムコンソールスワルは表示されませんが、データが渡されます

Uncaught ReferenceError: swal is not defined success @ CustomerLoyalty:40 (anonymous function) @ 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> 

は、上記の私のSwaI機能とある「のSwaI(」警告! "、"失敗を記録できませんでした! "、" success ")"はコンソールでエラーをクリックすると赤で下線が引かれます。

にライン217を(スクリーンショットを参照):

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

誰もがここでいただきました!間違って私に言うことができますか?私は私のヘッダーにスワールリンクも貼り付けています。 screenshot:

答えて

0

と表示されている場合、swalスクリプトはまったく負荷をかけません。ロード中にネットワークタブを確認し、swal jsがロードされているかどうかを確認してください。

+0

答えを参照してください、それを解決!とにかく、ありがとう ! –

0

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"); }); 
} 

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

関連する問題