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
<input type="button" onclick="func()" value="点击刷新" />
<script>
function func(){
window.wd.location.reload();
}
</script>
想做一个点击刷新iframe里的页面。window.wd.location.reload();
这个wd换成document.getElementById('wd')反而不运行了,只能直接调用才会正常运行。请问是为什么呢?这样按照道理是不规范的写法把