Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts

    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

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,225
    Thanks
    80
    Thanked 4,456 Times in 4,421 Posts
    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.

  • Users who have thanked Old Pedant for this post:

    rfresh (04-07-2009)

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    I see...interesting idea...I'll work on it.

    Thanks...
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •