1 回答

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超6個(gè)贊
這樣調(diào)用,代碼如下
頁面1
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>父頁面</title>
</head>
<script>
function callback(e){
alert(e)
}
</script>
<body>
<iframe src="index3.html"></iframe>
</body>
</html>
頁面2
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>子頁面</title>
</head>
<script>
function opentargetWin(){
window.parent.callback('調(diào)用目標(biāo)彈出窗口!');
}
</script>
<body>
<input type="button" value="打開窗口" onclick="opentargetWin()">
</body>
</html>
添加回答
舉報(bào)