Hi
I have been having a very wierd problem with using setInterval javascript method on IE 6/7.
I am trying to kick off an application installation from IE (opening the exe in a new window). And then keep running a js function in infinite loop to check if the installation is complete. The exe is our custom build exe and registers an activex progid in registry after successfull installation.
The problem is with the time interval which i am using. If i use 500 ms then even after the installation the activex object cannot be instantiated. However if i increase the time interval to around 6000 ms (on some pc's 1000ms also works), then it starts working fine (i.e., able to instantiate actviex object after installation)..
My code looks like below.
var intervalTime = 500;
function CheckComplete()
{
clearInterval(intervalId);
var installed = false;
try
{
var objInstaller = new ActiveXObject('xxxx.xxxx');
if(objInstaller){installed = true;}
objInstaller = null;
}catch(ex) {}
if (installed == false)
{
intervalId = setInterval('CheckComplete()', intervalTime);
}
else
{
InstallIsComplete();
}
}
function StartInstallApplication()
{
intervalId = setInterval('CheckComplete()', intervalTime);
}
Now, if I increase the time interval it works fine.
Have anyone of you ever faced this problem and have a solution for this.
It would be really grateful if anyone can help me.
Thanks and Regards
Guru