基本上,我有一个iframe
嵌入在页面中,并iframe
有一些我需要从父页面调用的JavaScript例程.
现在相反的情况非常简单,因为你只需要打电话parent.functionName()
,但不幸的是,我需要完全相反.
请注意,我的问题是不会改变的源URL的iframe
,但是调用在定义的函数iframe
.
我试图在复选框点击时将div标签显示给另一个框架集.
我的index.html文件是
<html>
<head>
<title></title>
</head>
<frameset cols="25%,75%">
<frame src="left-panel.html"></frame>
<frame src="right-panel.html"></frame>
</framset>
</html>
Run Code Online (Sandbox Code Playgroud)
左panel.html
<html>
<body>
<script src="min.js"></script>
<script src="file.js"></script>
<input type="checkbox" value = "1" class="theClass">Click<h1>
<input type="checkbox" value = "2" class="theClass">Click<h1>
<input type="checkbox" value = "3" class="theClass">Click<h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
右panel.html
<html>
<body>
<script src="min.js"></script>
<script src="file.js"></script>
<div id="footer" style="width:98%; background:blue; height:10%; position:absolute; bottom:0; visibility:hidden;"></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
然后我的js文件是
$('.theClass').change(function(){
($('.theClass:checked').map(function(){ myfunction(this.value); }).get())
});
function myfunction(ad)
{
document.getElementById("footer").innerHTML = ad;
}
Run Code Online (Sandbox Code Playgroud)
单击复选框时,我想将这些复选框值显示在另一个html的页脚div中