2010-02-25 25 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