bugsnail
0.07D
V2EX  ›  问与答

sweetalert 这个插件, 成功之后按 esc 退出后怎么刷新当前页面?

  •  
  •   bugsnail · Dec 23, 2016 · 1202 views
    This topic created in 3426 days ago, the information mentioned may be changed or developed.
    bugsnail
        1
    bugsnail  
    OP
       Dec 23, 2016
    仔细再刷了一遍官方文档, 找到答案了:

    ``` javascript
    swal({
    title: data.msg,
    type: "success",
    confirmButtonText: "确定",
    closeOnConfirm: true
    }, function (isConfirm) {
    if(isConfirm){
    location.reload(true);
    }else{
    location.reload(true);
    }
    });
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1032 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 19:27 · PVG 03:27 · LAX 12:27 · JFK 15:27
    ♥ Do have faith in what you're doing.