Script SweetAlert


JS

Script SweetAlert


ตัวอย่าง SweetAlert


<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<button class="btn btn-info" aria-label="Try me! Example: Dynamic queue" onclick="swalinfo()">
    info
</button>
<button class="btn btn-warning" aria-label="Try me! Example: Dynamic queue" onclick="swalerror()">
    error
</button>

<button class="btn btn-success" aria-label="Try me! Example: Dynamic queue" onclick="swalsuccess()">
        success
</button>

<script type="text/javascript">
    function swalinfo(){
        swal("หัวข้อ Info", "ข้อความ Info!!!", "info")
        //setTimeout(function(){window.top.location="./?page=list_link_sweetalert", 10000} );
    }
    function swalerror(){
        swal("หัวข้อ Error", "ข้อความ Error!!!", "error")
        //setTimeout(function(){window.top.location="./?page=list_link_sweetalert", 10000} );
    }
    function swalsuccess(){
        swal("หัวข้อ Success", "ข้อความ Success!!!", "success")
        //setTimeout(function(){window.top.location="./?page=list_link_sweetalert", 10000} );
    }
</script>