您的位置:首页 > 其它

electron 中文文档

2016-04-13 18:36 323 查看
假设有

A.html , B.html

A.html使用js的window.showModalDialog('B.html');

B.html的js里面使用跳转location.href = "http://www.baidu.com";

firefox、chrom 会在弹出框内跳转,IE 会弹出新窗口去显示href的连接

解决方法有两种..

1. location.href = "http://www.baidu.com"; 换成

window.name = "__self";
window.open("http://www.baidu.com" , "__self");

2.新建一个页面C.html加入iframe连接B.html,那么就可以随意使用跳转

A.html js部分类容:

function openWindow(url){
window.showModalDialog(url, null , "dialogWidth=800px;dialogHeight=504px;scroll=0");
location.reload();
}

C.html内容:

<body style="width:800px; height:500px;padding:0px ; margin:0px;" >
<iframe frameborder="0" style="width:800px; height:500px" src="b.html">
</iframe>
</body>


本文出自 “Hover_java” 博客,转载请与作者联系!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: