長風秋雁
2018-09-12 09:06:37
我在一個HTML文件(delete-window.html)中設計了一個可以彈出的窗口,在另一個HTML文件(delete-business.html)中想調用那個可以彈出的窗口,要如何調用。代碼:1.<delete-window><div class="ui basic modal" id="">
<i class="close icon" onclick="$('.ui.basic.modal').modal('hide');"></i>
<div class="header"> Are you sure to delete?
</div></delete-window>2.<delete-business><script>function deleteBiz() {
$('delete-window.ui.basic.modal').show();
}</script></delete-business>
1 回答

夢里花落0921
TA貢獻1772條經驗 獲得超6個贊
這樣調用,代碼如下
頁面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('調用目標彈出窗口!');
}
</script>
<body>
<input type="button" value="打開窗口" onclick="opentargetWin()">
</body>
</html>
添加回答
舉報
0/150
提交
取消