...

View Full Version : ajax progress display?



rfresh
04-06-2009, 04:49 PM
I'm fetching some search text results on the sever with my ajax form - is there a way to show progress of the search rather than wait until the search is completed and then returning the results?

I'd like to be able to return each hit (find results) back to the form as it happens so the user can see something is happening. Is there a state that I can test for to do this?

Thanks...

Old Pedant
04-07-2009, 06:36 AM
Look here:

http://www.codingforums.com/showthread.php?t=162558

From just a few days ago.

Using a GUID to identify the client to the two AJAX pages seems like the best idea.

rfresh
04-07-2009, 04:42 PM
I see...interesting idea...I'll work on it.

Thanks...

rfresh
04-07-2009, 10:46 PM
This is my ajax function code.

Where would I insert my secondary ajax 'progress' call within this primary ajax call?



function test_ajax_call()
{
var argument = "test";
var url = "AjaxClickServer.php";
var params = "arg=" + agrument;
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function()
{
if (http.readyState == 4) //Finished loading the response
{
if (http.status == 200)
{
var response = http.responseText;
}
else
{
alert("Ajax error: " + http.statusText);
}
}
}
http.send(params);
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum