嵌套 iframe 取值
来源:互联网 发布:电视软件安装 编辑:程序博客网 时间:2024/05/29 15:10
index.html
parent.html
sub.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Test</title>
<script type="text/javascript">
function getSub(grandpa,parent,target)
{
//alert('ok');
var frameObjId = document.getElementById(grandpa);
var cognosSdkIfr = frameObjId.contentWindow.document.getElementById(parent);
var biccObjId = cognosSdkIfr.contentWindow.document.getElementById(target);
alert(biccObjId.value);
}
</script>
</head>
<body>
This is in grandpa.<br/>
<iframe id="grandpa" src="http://ayue05.blog.163.com/blog/parent.html" width="400px" height="300px"></iframe>
<br/>
<a href="http://ayue05.blog.163.com/blog/#" onclick="getSub('grandpa','parent','inputtest')">取得sub</a>
</body>
</html>
<html>
<head>
<title>Father</title>
</head>
<body>
In father.<br/>
<iframe id="parent" src="http://ayue05.blog.163.com/blog/sub.html"></iframe>
</body>
</html>
<html>
<head>
<title>sub</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<body>
<div id="subcontent" class="color:red;">
输入字符,点击下面链接获取内容
<input id="inputtest" type="text" name="test"/>
</div>
</body>
</html>
parent.html
sub.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Test</title>
<script type="text/javascript">
function getSub(grandpa,parent,target)
{
//alert('ok');
var frameObjId = document.getElementById(grandpa);
var cognosSdkIfr = frameObjId.contentWindow.document.getElementById(parent);
var biccObjId = cognosSdkIfr.contentWindow.document.getElementById(target);
alert(biccObjId.value);
}
</script>
</head>
<body>
This is in grandpa.<br/>
<iframe id="grandpa" src="http://ayue05.blog.163.com/blog/parent.html" width="400px" height="300px"></iframe>
<br/>
<a href="http://ayue05.blog.163.com/blog/#" onclick="getSub('grandpa','parent','inputtest')">取得sub</a>
</body>
</html>
<html>
<head>
<title>Father</title>
</head>
<body>
In father.<br/>
<iframe id="parent" src="http://ayue05.blog.163.com/blog/sub.html"></iframe>
</body>
</html>
<html>
<head>
<title>sub</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<body>
<div id="subcontent" class="color:red;">
输入字符,点击下面链接获取内容
<input id="inputtest" type="text" name="test"/>
</div>
</body>
</html>
0 0
- 嵌套 iframe 取值
- 多层iframe嵌套使用相互取值
- iframe取值
- iframe取值备忘
- 嵌套json取值
- Firefox 下 iframe 取值
- iframe jsp 提交取值
- iframe取父页面值
- jquery嵌套取值问题
- Repeater嵌套CheckBoxList ,取值
- JSONArray 嵌套JSONArray 取值
- iframe嵌套用法
- 查找所有嵌套iframe
- Iframe指定位置嵌套
- iframe防止嵌套
- selenium 嵌套iframe
- iframe网页嵌套效果
- div中嵌套iframe
- The Setup of C
- js判断页面是刷新还是关闭 (兼容FF。IE)
- FCK 实现Ctrl+Enter提交
- Fckeditor的配置及使用(全)
- JS获取FckEditor的值 FCK
- 嵌套 iframe 取值
- showModalDialog 传值及刷新。弹出子页面,回传给父页面
- JS。图片上传预览,兼容FF
- 在线聊天.NET源码 即时
- JS过虑HTML
- 让DIV的滚动条自动滚动到最底部 - 4种方法(第二种好用)
- js关闭当前页面的几种方式
- jQuery实现AJAX定时局部页面刷新
- 设为首页,收藏本站