shavenlunatic
MIS
OK, I'll try explain what I need/would like help with without confusing myself and any innocent bystanders
index.php contains various divs with includes to other php files which gather various bits of information.
one of these divs (called "link")includes a makelink.php which (for the sake of keeping this simple) creates a link of the <a href="Javascript: Dostuff(Variable)"></a> variety
Now, that javascript is along the lines of:
the "DoSomething.php" does a few checks, updates a mysql db and generally has a good old time. The concern I have is the timeout.. it's hardly a safe way of ensuring nobody gets the page refresh before the server has finished processing.
Now, ideally I'd want the process to be like this:
1. xmlHttp.open("GET",url,true)
2. waits until the above has finished processing
3. ajaxpage('/makelink.php', 'link')
4. ajaxpage('/someother.php', 'anotherdiv')
to have the whole process a nice, seamless process with no full page refreshes and for everything to be guaranteed up-to-date on their screen by the time everything reloads
Is this possible? or am I just setting myself up for disappointment?
Any help will be appreciated.
Cheers
________
clueless
index.php contains various divs with includes to other php files which gather various bits of information.
one of these divs (called "link")includes a makelink.php which (for the sake of keeping this simple) creates a link of the <a href="Javascript: Dostuff(Variable)"></a> variety
Now, that javascript is along the lines of:
Code:
function DoStuff(Variable)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="/DoSomething.php?Variable="+Variable+";
xmlHttp.readystate
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
setTimeout("window.location = '/index.php'",200);
}
the "DoSomething.php" does a few checks, updates a mysql db and generally has a good old time. The concern I have is the timeout.. it's hardly a safe way of ensuring nobody gets the page refresh before the server has finished processing.
Now, ideally I'd want the process to be like this:
1. xmlHttp.open("GET",url,true)
2. waits until the above has finished processing
3. ajaxpage('/makelink.php', 'link')
4. ajaxpage('/someother.php', 'anotherdiv')
to have the whole process a nice, seamless process with no full page refreshes and for everything to be guaranteed up-to-date on their screen by the time everything reloads
Is this possible? or am I just setting myself up for disappointment?
Any help will be appreciated.
Cheers
________
clueless