blue_topaz
11-13-2006, 08:55 AM
In the application , i want to load the script in a frame, and while the script gets loaded i display a modaldialog.
To do this, I attach the event "onreadystatechange" to the frame in the method "ProcessPage". The handler for this event is "LoadScript" method which sets the boolean var bScriptLoaded to true when the script is loaded.
I call method ProcessPage through showModalDialog. The dialog should close when the var bScriptLoaded is set to true.
The problem is that the Modaldialog window does not close as "bSciptLoaded" does not get true.Its because the event does not get fired.
When I manually close the modaldialog, the event onreadystatechange gets fired and then the LoadScript is called.
So why does the event "onreadystatechange" does not get fired when modaldialog is opened in InternetExplorer7? This works fine in IE 6.
code is as follows:
function ProcessPage
{.....
tpageElement.attachEvent("onreadystatechange", loadManager = function()
{if(tpageElement.readyState=='complete'){LoadScript();}}
.....
}
function LoadScript
{
//Loads the script and sets bScriptLoaded = true.
}
function mymainmethod
{
...
showModalDialog("process.htm",args,param1);
....
}
process.htm
...
args.fn(); //Executes ProcessPage method.
Loop = window.setInterval("Check()",1);
....
function Check()
{
if(args.bScriptLoaded == true)//Checks for the boolean var
{
window.clearInterval(Loop);
window.returnValue = true;
window.close();
}
}
To do this, I attach the event "onreadystatechange" to the frame in the method "ProcessPage". The handler for this event is "LoadScript" method which sets the boolean var bScriptLoaded to true when the script is loaded.
I call method ProcessPage through showModalDialog. The dialog should close when the var bScriptLoaded is set to true.
The problem is that the Modaldialog window does not close as "bSciptLoaded" does not get true.Its because the event does not get fired.
When I manually close the modaldialog, the event onreadystatechange gets fired and then the LoadScript is called.
So why does the event "onreadystatechange" does not get fired when modaldialog is opened in InternetExplorer7? This works fine in IE 6.
code is as follows:
function ProcessPage
{.....
tpageElement.attachEvent("onreadystatechange", loadManager = function()
{if(tpageElement.readyState=='complete'){LoadScript();}}
.....
}
function LoadScript
{
//Loads the script and sets bScriptLoaded = true.
}
function mymainmethod
{
...
showModalDialog("process.htm",args,param1);
....
}
process.htm
...
args.fn(); //Executes ProcessPage method.
Loop = window.setInterval("Check()",1);
....
function Check()
{
if(args.bScriptLoaded == true)//Checks for the boolean var
{
window.clearInterval(Loop);
window.returnValue = true;
window.close();
}
}