繁体   English   中英

在 jQuery 中重新加载页面后打开模态

[英]open modal after reload page in jQuery

我需要一种在重新加载页面后打开模式的方法。 我需要在再次打开模式之前更新结果。 我正在使用这种方法,但它不起作用:

if (data == "done") {
  Swal.fire({
    icon: 'success',
    html: '<?= $getTranslation->tr('success') ?>',
    confirmButtonText: '<?= $getTranslation->tr('confirm') ?>',
    showCloseButton: true
  }).then((result) => {
    if (result.isConfirmed) {
      // location.reload();
      $('.step-6-modal').modal('show');
    }
  })
}
window.onload = function() {
    ajaxRequest(request).then(data => {
        if (data == "done") {
            Swal.fire({
                icon: 'success',
                html: '<?= $getTranslation->tr('success') ?>',
                confirmButtonText: '<?= $getTranslation->tr('confirm') ?>',
                showCloseButton: true
            }).then((result) => {
                if (result.isConfirmed) {
                // location.reload();
                $('.step-6-modal').modal('show');
                }
            })
        }
    })
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM