I have 3 frame (not frame set)
and I want to forse frame1 (where I define language for user) to be
load first, before any other frames. And if possible reload main page.
How should I do it from the main aspx page?
(ASP.NET)
thank you very...
I am not sure if you can control the loading of a frame, but when I had
a problem of using results of a frame before the frame actually loaded,
I set up a timer to prevent this.
In frame1, have a <body onload=first();> and in first() you set a flag
like below. My page took a long time to load because of doing much PHP
stuff there.
Then in the page where you want to delay the onload function, have its
onload function (say, loadPageB), look like below.
The way this works is that the timer is set up in loadTimerB and when it
expires 100msec later, loadTimer is called which checks the flag. If the
loading completed, it calls the onload function again, otherwise it
restarts the timer.
This worked well for me but I would be interested to see other
techniques.
function first ()
{
loadComplete = true;
}
function loadTimer ()
{
if (loadComplete==true)
{
loadFunction ();
return;
}
setTimeout ("loadTimer ()", 100);
}
function loadTimerB (loadFunc)
{
if (loadComplete==true)
{
return true;
}
loadFunction = loadFunc;
setTimeout ("loadTimer ()", 100);
return false;
}
function loadPageB ()
{
var result;
result = loadTimerB (loadPageB);
if (result==false)
{
return;
}
// real work to complete initialising this page done here
}
var loadComplete = false;
var loadFunction;
-- tim