2010-02-25 73 views
1

我忙着寫一個完全刷新使用javascript一個iframe中的應用程序,現在我的問題是,我在IE 6是contentDocument.location.reload兼容IE 6

'document.getElementById(...).contentDocument.location' is null or not an object 

收到以下錯誤我的代碼看起來像這樣

document.getElementById('mobi').contentDocument.location.reload(true); 

和mobi存在。摩比是iframe

回答

3

使用contentWindow舊IE :)

的document.getElementById( '摩比')的id contentWindow.location.reload(真)。

(閱讀更多關於contentWindow

+0

+1,這是工作的Chrome和Firefox,以及... – gotqn 2012-08-09 09:54:49