iframe 取值问题····· mainFrame.document.getElementById("你需要获取的控件的ID") 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不行 返回 NULL·· parent.mainFrame.document.getElementById("你需要获取的控件的ID") 还是不对,我那页面就一个iframe 没有大框架,我是提交后 还是提交到本页面来取的 <td width="440" align="left" valign="top" ><iframe width=520 height=400 name="mainFrame" id="mainFrame" src="xxxxx.html" border=0 scrolling=no> </iframe></td> <script language = javascript> window.onload = function(){ alert(window.mainFrame.document.all.xxxxx.value); }</script>测试过了 可以window.mainFrame.document.all.xxxxx.value <td width="440" align="left" valign="top" ><iframe width=520 height=400 name="mainFrame" id="mainFrame" src="xxxxx.html" border=0 scrolling=no> </iframe></td> <script language = javascript> window.onload = function(){ alert(window.mainFrame.document.all.xxxxx.value); }</script>测试过了 可以window.mainFrame.document.all.xxxxx.value <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script>window.onload=function(){alert(mainFrame.document.getElementById("test").value);};</script></head><body><iframe width=520 height=400 name="mainFrame" id="mainFrame" src="tt.html" border=0 scrolling=no> </iframe> </body></html>tt.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><input id="test" name="test" value="测试"/></body></html> 是不是你iframe中的代码有问题呀。把代码帖出来看看吧。 javascript 如何創建 json 急!查找父窗体 散分!寻求好用的js混淆器或加密方式! 在1个可编辑的div里面,如何获得文本光标的坐标,以便于在光标处弹出关联菜单? 怎么样让关闭按钮居右显示??? 正则替换! 网页播放mp3,怎么判断mp3开始播放??????????? 用JAVASCRIPT如何把在B页面中的记录赋值到A页面中的TEXTFIELD中? 如何控制刷新另一个页面 怎么实现点击按钮 换一组轮播图?求大神 问老大我照猫画虎画的错在哪里啊 html代码无法识别,被看作是一条字符串
<iframe width=520 height=400 name="mainFrame" id="mainFrame" src="xxxxx.html" border=0 scrolling=no> </iframe>
</td>
<script language = javascript>
window.onload = function(){
alert(window.mainFrame.document.all.xxxxx.value);
}
</script>
测试过了 可以
window.mainFrame.document.all.xxxxx.value
<iframe width=520 height=400 name="mainFrame" id="mainFrame" src="xxxxx.html" border=0 scrolling=no> </iframe>
</td>
<script language = javascript>
window.onload = function(){
alert(window.mainFrame.document.all.xxxxx.value);
}
</script>
测试过了 可以
window.mainFrame.document.all.xxxxx.value
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
window.onload=function(){alert(mainFrame.document.getElementById("test").value);};
</script>
</head>
<body>
<iframe width=520 height=400 name="mainFrame" id="mainFrame" src="tt.html" border=0 scrolling=no> </iframe>
</body>
</html>tt.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<input id="test" name="test" value="测试"/>
</body>
</html>
把代码帖出来看看吧。