iframe中子页面调用父页面的js方法
2010-05-06 09:49
295 查看
有两个页面
client.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function a(){
alert('frame子窗体调用父窗体方法');
}
</script>
</head>
<body>
<iframe name="main" style="width:40px; height:40px; border:0px;" scrolling="no" src="blank.html" ></iframe>
<a href="server.html" target="main" >js remote </a>
</body>
</html>
server.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
阿里山的肌肤 撒旦飞爱上地方撒地方撒 反对撒
撒地方撒
<script type="text/javascript">
window.parent.a();
</script>
</body>
</html>
client.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function a(){
alert('frame子窗体调用父窗体方法');
}
</script>
</head>
<body>
<iframe name="main" style="width:40px; height:40px; border:0px;" scrolling="no" src="blank.html" ></iframe>
<a href="server.html" target="main" >js remote </a>
</body>
</html>
server.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
阿里山的肌肤 撒旦飞爱上地方撒地方撒 反对撒
撒地方撒
<script type="text/javascript">
window.parent.a();
</script>
</body>
</html>
相关文章推荐
- action 调用jsp页面的js方法
- iframe页面里的js调用父级页面js函数的解决方法
- iframe 父页面调用子页面里面的js方法
- 子页面调用父页面的js方法
- js中调用父页面的方法
- H5页面调用Android 端js方法阻塞问题
- 利用js调用iframe中父页面/子页面中的JavaScript方法
- iframe里面的页面调用父窗口,左右窗口js函数的方法
- Unity,WebGL, 页面JS调用Unity方法
- jquery 调用子iframe页面中js的方法
- 离开页面前调用Js方法
- C#后台调用前台页面js方法
- js中子页面父页面方法 变量相互调用
- js调用父框架函数与弹窗调用父页面函数的方法
- IFRAME弹出式窗口回发数据到父页面[调用父页JS方法并模拟调用按钮的回发事件]
- 每个 GROUP BY 表达式必须至少包含一个不是外部引用的列、加载页面时调用Js方法、调用Js文件中的方法
- 页面内调用js函数出错:“缺少对象”的解决方法
- 解决同一页面中两个iframe互相调用jquery,js函数的方法
- iframe里面的页面调用父窗口,左右窗口js函数的方法
- iframe父级页面与子级页面互相调用js的方法