为什么不需要读取ID了呢?
javascript吧
全部回复
仅看楼主
level 8
jy03692141 楼主
<iframe src="332.html" id="wd" style="width:200px; height:200px"></iframe>
<input type="button" onclick="func()" value="点击刷新" />
<script>
function func(){
window.wd.location.reload();
}
</script>
想做一个点击刷新iframe里的页面。window.wd.location.reload();
这个wd换成document.getElementById('wd')反而不运行了,只能直接调用才会正常运行。请问是为什么呢?这样按照道理是不规范的写法把
2012年04月21日 15点04分 1
level 11
ie 里面 ifream ,
记不太清楚了,看下手册吧,里面说过这个:
https://tieba.baidu.com/p/1254290713#16200694066
2012年04月21日 16点04分 2
level 6
document.getElementById('wd')和document.wd差不多,但与
window.wd就有分别了。
2012年04月22日 03点04分 3
1