bugsnail
0.07D
V2EX  ›  问与答

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

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

    ``` 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   ·   Privacy   ·   Solana   ·   2051 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 12:41 · PVG 20:41 · LAX 04:41 · JFK 07:41
    ♥ Do have faith in what you're doing.