【发布时间】:2014-02-10 07:22:53
【问题描述】:
我有两个 html 页面..我正在从子级调用父窗口..一切都很好。但是在 Chrome 中它失败了..让我知道原因..
test1.html :-
<html>
<head>
<title>Compose</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<SCRIPT>
function test(){
//alert('');
var win = window.open('../login/test2.html',"","height=700,width=800");
}
function test1(){
alert('test1');
}
</SCRIPT>
</head>
<body>
<input type="button" value="click" onclick="test();" />
</body>
</html>
test2.html :-
<html>
<head>
<title></title>
<SCRIPT>
function opener1(){
try{
if(window.opener != null && !window.opener.closed)
{
}
window.opener.test1();
}catch(e){ alert(e.description);}
}
</SCRIPT>
</head>
<body oncontextmenu="return false" ondragstart="return false" onload="opener1();">
<h1>Test Page</h1>
</body>
</html>
从 test2.html 调用 test1.html 中的方法不起作用..任何解决方案..赞赏..谢谢
【问题讨论】:
标签: javascript html google-chrome