V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
bugsnail
0.07D
V2EX  ›  问与答

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

  •  
  •   bugsnail · Dec 23, 2016 · 1177 views
    This topic created in 3413 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   ·   5217 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 01:13 · PVG 09:13 · LAX 18:13 · JFK 21:13
    ♥ Do have faith in what you're doing.