opener
父窗體需要頂一個show() 方法
父面頁代碼
<!DOCTYPE HTML PUBLIC "
<html>
<head>
<title>html
<meta http
<meta http
<meta http
<!
</head>
<body>
<div>
<button id="btn">open new page</button>
</div>
<script>
window
var btn = document
btn
function openPage(){
try {
window
}catch(e){
alert(e);
}
//alert("ok");
}
}
function show(){
document
}
</script>
</body>
</html>
newpage
<!DOCTYPE HTML PUBLIC "
<html>
<head>
<title>newpage
<meta http
<meta http
<meta http
<!
</head>
<body>
<button id="btn" onclick="fun()">單擊</button>
<script>
function fun(){
opener
}
</script>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20535.html