我打开了一个窗口,当前窗口在i.E10中可以正常工作但在chrome和firefox中不起作用。我给出的代码请查看并给我一个解决方案。
父窗口HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript">
function openPopUP() {
window.open('hidden.html','NewWin',
'toolbar=no,status=no,width=350,height=135')
}
</script></head>
<body onLoad="openPopUP();">
<!--// <a href="javascript:hide();">Click</a> to open a small hidden window.-->
</body>
</html>
儿童Winow,即PopUp窗口文件代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body onLoad="window.parent.opener.focus(); "
>
window is open
</body>
</html>