PDA

View Full Version : Element not available in onReady in IE7



nagir
17 Jul 2008, 7:44 PM
Hi,

I am a bit confused and stuck with this problem. The code is as simple as that:

Ext.onReady(function(){
alert(document.getElementById('myContainer'));
});The HTML has "myContainer" DIV with some content in it.
But I can see message box with "null" in IE7 (which is unexpected) and the valid element in FF3.
I tried to localise the problem but it does work in smaller samples. It doesn't on the real page (which is too large and bloated to post here).

Could you please give a suggestion where I should dig and what might be the cause of this issue?

At least any ideas or thought, please.

Thanks in advance,
Dmitriy.

evant
17 Jul 2008, 8:57 PM
There's a bug that causes onReady not to work correctly in some situations, see: http://extjs.com/forum/showthread.php?t=22037&highlight=onReady

nagir
17 Jul 2008, 10:51 PM
Hi,

Thank you very much for the help. I would hardly ever figure this bug.
I tried to apply patches but I probably missed something and it didn't work.
I'm not very advanced JS developer, so I decided to use defer for now and hopefyly the time spceified will be enough for IE to load the content.

Ext.onReady(function(){
performInit.defer(2000, this);
});Thanks one more time for the help.
Dmitriy.