我在一个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
提交
取消