ksachdeva
08-03-2007, 03:38 PM
Versions of ExtJS that can be used to reproduce the problem : 1.0.1 & 1.1.
A test HTML file is attached which you can put in examples\test directory in your local ExtJS to reproduce the problem.
Story:
I was still using 1.0 till yesterday and things were ok with me. I switched to ExtJS 1.1 and suddenly my app would not work in IE (6 as well as 7). It works fine in Firefox. Here is the code which creates the problem:
var initDocReady = function(){
docReadyEvent = new Ext.util.Event();
if(Ext.isGecko || Ext.isOpera) {
document.addEventListener("DOMContentLoaded", fireDocReady, false);
}else if(Ext.isIE){
document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
var defer = document.getElementById("ie-deferred-loader");
// PROBLEM IS THAT VARIABLE defer IS "null" if I use on-demand javascript to fetch
// ext-all.js
defer.onreadystatechange = function(){
if(this.readyState == "complete"){
fireDocReady();
defer.onreadystatechange = null;
defer.parentNode.removeChild(defer);
}
};
}else if(Ext.isSafari){
docReadyProcId = setInterval(function(){
var rs = document.readyState;
if(rs == "complete") {
fireDocReady();
}
}, 10);
}
E.on(window, "load", fireDocReady);
};
Since it was working fine I went back and compared this snippet with the one in 1.0 and there was indeed a little difference; Here is the old code for IE in initDocReady which works fine:
if(Ext.isIE){
document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
E.on("ie-deferred-loader", "readystatechange", function(){
if(this.readyState == "complete"){
fireDocReady();
}
});
}
Would appreciate the guidance on this.
Regards & thanks
Kapil
A test HTML file is attached which you can put in examples\test directory in your local ExtJS to reproduce the problem.
Story:
I was still using 1.0 till yesterday and things were ok with me. I switched to ExtJS 1.1 and suddenly my app would not work in IE (6 as well as 7). It works fine in Firefox. Here is the code which creates the problem:
var initDocReady = function(){
docReadyEvent = new Ext.util.Event();
if(Ext.isGecko || Ext.isOpera) {
document.addEventListener("DOMContentLoaded", fireDocReady, false);
}else if(Ext.isIE){
document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
var defer = document.getElementById("ie-deferred-loader");
// PROBLEM IS THAT VARIABLE defer IS "null" if I use on-demand javascript to fetch
// ext-all.js
defer.onreadystatechange = function(){
if(this.readyState == "complete"){
fireDocReady();
defer.onreadystatechange = null;
defer.parentNode.removeChild(defer);
}
};
}else if(Ext.isSafari){
docReadyProcId = setInterval(function(){
var rs = document.readyState;
if(rs == "complete") {
fireDocReady();
}
}, 10);
}
E.on(window, "load", fireDocReady);
};
Since it was working fine I went back and compared this snippet with the one in 1.0 and there was indeed a little difference; Here is the old code for IE in initDocReady which works fine:
if(Ext.isIE){
document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
E.on("ie-deferred-loader", "readystatechange", function(){
if(this.readyState == "complete"){
fireDocReady();
}
});
}
Would appreciate the guidance on this.
Regards & thanks
Kapil