我有两个HTML页面。我正在从子窗口调用父窗口。所有的东西都很好,但在Chrome浏览器中失败了。请告诉我原因。
test1.html:-
从test2.html调用test1.html中的方法不起作用,有什么解决方案吗?感激不尽,谢谢。
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中的方法不起作用,有什么解决方案吗?感激不尽,谢谢。