Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-06-2009, 03:49 PM   PM User | #1
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
ajax progress display?

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...
__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Old 04-07-2009, 05:36 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,578
Thanks: 62
Thanked 4,063 Times in 4,032 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is online now   Reply With Quote
Users who have thanked Old Pedant for this post:
rfresh (04-07-2009)
Old 04-07-2009, 03:42 PM   PM User | #3
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
I see...interesting idea...I'll work on it.

Thanks...
__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Old 04-07-2009, 09:46 PM   PM User | #4
rfresh
Regular Coder

 
Join Date: Jun 2007
Location: Los Angeles
Posts: 545
Thanks: 81
Thanked 5 Times in 5 Posts
rfresh is an unknown quantity at this point
This is my ajax function code.

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

PHP Code:
function test_ajax_call()
{
    var 
argument "test";
    var 
url "AjaxClickServer.php";
    var 
params "arg=" agrument;
    
http.open("POST"urltrue);
    
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);

__________________
RalphF
Business Text Messaging Services
https://www.MobileTextingService.com
rfresh is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:53 AM.


Advertisement
Log in to turn off these ads.