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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    135
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XMLHttpRequest progress

    I have an AJAX form, and its PHP process time is between 30 seconds to 2-3 minutes. I want to add some kind of progress bar, to show the user indication of how many % already ended.

    The first thing I thought is using onreadystatechange to increase the element, but it changes at the beginning and right before the PHP returning the results.

    Is there other way to find the % of the progress?

    Thanks a lot

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I don't think you can get an accurate % progress (if at all). You will never know beforehand how long an HTTP request will be processed by the server. Why not just put a "Loading..." status message?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    Aug 2006
    Posts
    135
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by glenngv View Post
    I don't think you can get an accurate % progress (if at all). You will never know beforehand how long an HTTP request will be processed by the server. Why not just put a "Loading..." status message?
    That's what I'm doing now, but I wanted to try a progress bar.
    Maybe I'll stick with the "loading" message.


  •  

    Posting Permissions

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