H
Hansen
Hi!
I have a problem with an object not yet being initialized when I try to
access it. Hence I would like to wait for the object to be initialized. I
have the following code:
try
{
if(gridArray == null)
{
setTimeout("waitForGridArray()", 500);
}
for (var i = 0; i < gridArray.length; ++i)
.....
}
}
catch(e)
{
alert(e.message);
}
function waitForGridArray()
{
if(gridArray == null)
{
setTimeout("waitForGridArray()", 500);
alert("Waiting);
}
}
The problem is that even though I want to wait I get an "gridArray.length is
null or not an object" error, followed by the "Waiting" alert.
Why doesn't it wait until gridArray is ready and the continue? (Windows
Server 2003)
Best regards
Hansen
I have a problem with an object not yet being initialized when I try to
access it. Hence I would like to wait for the object to be initialized. I
have the following code:
try
{
if(gridArray == null)
{
setTimeout("waitForGridArray()", 500);
}
for (var i = 0; i < gridArray.length; ++i)
.....
}
}
catch(e)
{
alert(e.message);
}
function waitForGridArray()
{
if(gridArray == null)
{
setTimeout("waitForGridArray()", 500);
alert("Waiting);
}
}
The problem is that even though I want to wait I get an "gridArray.length is
null or not an object" error, followed by the "Waiting" alert.
Why doesn't it wait until gridArray is ready and the continue? (Windows
Server 2003)
Best regards
Hansen