单击确定后,sweetalert2应重定向到另一个html

时间:2017-10-24 14:06:28

标签: javascript sweetalert2

未显示警报,以及重定向无法正常工作

        //sweetalert2
        swal({
            title: "Success!",
            text: "Agent Created Successfully.",
            type: "success",
        }.then(function(){
            alert('here');
            window.location.href = "example.html";
        }));

1 个答案:

答案 0 :(得分:0)

看起来你的paren错位了:

    //sweetalert2
    swal({
        title: "Success!",
        text: "Agent Created Successfully.",
        type: "success",
    }).then(function(){
        alert('here');
        window.location.href = "example.html";
    });