【问题标题】:Jquery Popup/Modal-Box with Forwarding (and Event?)带有转发(和事件?)的 Jquery 弹出/模态框
【发布时间】:2011-08-04 19:38:51
【问题描述】:

我希望有人可以帮助我...

index.php (http://jsbin.com/elocek)

<script type="text/javascript">
$(document).ready(function() { 
    $('.open').popupWindow({ 
    windowURL:'popup.php', 
    windowName:'external' 
    });
 });
</script>

popup.php (http://jsbin.com/agepog)

<script type="text/javascript"> 
$(document).ready(function() { 

    $('.close').click(function() {
        window.close();
    });

    });
</script>

所以你可以看到 2 个文件,“index.php”只是整个文件中的一个 sn-p,但你可以看到 jquery 等。我的问题是我会打开一个弹出/模态框 - 见新窗口,如果我关闭弹出/模式框,想重新加载/刷新/替换主窗口(index.php)......这可能吗?

index.php 有一些额外的变量 e.q。 index.php?site=news&text=....

(抱歉我的英语不好)

【问题讨论】:

    标签: ajax jquery popup modal-dialog


    【解决方案1】:

    试试这个

    $(document).ready(function() { 
    
        $('.close').click(function() {
            window.opener.location.reload(true);
            window.close();
        });
    
        });
    

    【讨论】:

    • 感谢 Shankar ... "window.opener.location.reload(true);"工作或更好“window.opener.location.reload();”是否也可以转发到其他网址?
    • 传递 true 将尽量避免大多数浏览器中的表单发布确认。您可以只说 reload() 它会起作用,因为在您的情况下,我猜请求类型是 get。要打开一个新网址,只需将新网址设置为window.opener.location.href
    猜你喜欢
    • 1970-01-01
    • 2017-04-15
    • 2013-01-16
    • 1970-01-01
    • 1970-01-01
    • 2015-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多