window.showModalDialog使用总结

1.获取父页面的方法

父页面:

window.showModalDialog(’a.aspx’,self,'dialogWidth=700px;dialogHeight=400px;center=yes;status=yes;scroll=no') ;

这里的self就代表了父页面

子页面:

//获取父页面对象

var parentWin = window.dialogArguments;

2.解决window.showModalDialog 模态窗口中location 打开新窗口问题

var   a=document.createElement("a");  
a.href=url;   
document.body.appendChild(a);  
a.click();  

3.打开的子页面需要添加几个标签

    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Pragma" content="no-cache" />
    <base target="_self" />

posted on 2011-05-16 15:13  贾罗德  阅读(296)  评论(0编辑  收藏  举报

导航