【问题标题】:js dialog CLOSE attribute in the CSSCSS中的js对话框CLOSE属性
【发布时间】:2018-01-23 05:22:02
【问题描述】:

我有这个 html 和 js,我的所有网页都包含这些

<div id="dialog" title="MMS Message"></div>
<script>    
    function winAlert(msg) {
        $('#dialog').html(msg).dialog({
            resizable:true,    
            modal:true,
            hide: 'fade',           
            dialogClass: 'no-close dialog-dialog',
            close: function(event, ui) {
                        location.reload();
                    } //Reloads the Page
        });    
    } 
</script>

当我尝试在 UploadFunction.php 页面上使用它时,同一页面会一次又一次地执行。所以我厌倦了以下但仍然无法正常工作

echo "<script type=\"text/javascript\">
                         $('#dialog').css({ 'close': 'self['location'].replace('uploadFIR.php')'});

                        //window.location = \"uploadFIR.php\"
                    </script>"; 

【问题讨论】:

  • 您所说的“同一页面一次又一次地执行”是什么意思?
  • UploadFunction.php 再次加载,而不是 uploadFIR.php

标签: javascript redirect dialog location


【解决方案1】:

在 UploadFunction.php 页面上试试这个,

 $('#dialog').on('dialogclose', function(event) {
     window.location = 'uploadFIR.php';
 });

【讨论】:

  • 不,您的代码不起作用,但这是echo "&lt;script type=\"text/javascript\"&gt; function winAlert(msg) { $('#dialog').html(msg).dialog({ resizable:true, modal:true, hide: 'fade', dialogClass: 'no-close dialog-dialog', close: function(event, ui) { window.location = \"uploadFIR.php\"; } //Reloads the Page }); } winAlert(\"Records from Selected Excel File have been successfully Imported.\"); &lt;/script&gt;";
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多