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" />

你可能感兴趣的:(window.showModalDialog使用总结)