firefox沒有id問題 - 99%的時間是因爲你有一個缺少的id或者你重複了一個id。
ids在整個文檔中必須是唯一的。
到,雖然回答你的問題:
<iframe id="frame1"></iframe>
<iframe id="frame2"></iframe>
<input type="button" onclick="refreshFrames()" value="refresh frames" />
<script type="text/javascript">
function refreshFrames(){
frame1 = document.getElementById('frame1');
frame2 = document.getElementById('frame2');
if(frame1.contentDocument){
frame1.contentDocument.location.reload(true);
frame2.contentDocument.location.reload(true);
} else {
frame1.contentWindow.location.reload(true);
frame2.contentWindow.location.reload(true);
}
}
</script>
(使用IE,你可能需要使用的,而不是contentDocument取決於IE的版本你想支持contentWindow)
請更新您的html使用實際的html,並指定何時要重新加載iframe,以及是否要將表單提交到當前頁 – mplungjan 2011-03-07 10:46:40