3

Possible Duplicate:
Create a progress bar on $.ajax call

My problem is simple, I need to get the real-time loading percentage of an XMLHttpRequest, (i'm using Jquery's post() system) so i can display it with my progress bar.

I didn't managed to find how to do it, i found some method using php's flush(), but i'm not convinceed

So if anybody know a simple method to get the percentage so i can show current loading progress ...

The XMLHttpRequest is returning html code, it's a part of the page and i'm displaying it in a div. I want to put a progress bar in that div until i got all the datas ...

Edit : I'm not uploading anything, just sending an id to a php script and getting back the html datas.

Community
  • 1
  • 1
Weacked
  • 954
  • 2
  • 7
  • 18

1 Answers1

1

post event had just three method to handle i.e .error(), .success(), and .complete() so we can't handle such but there may be alternate solution, to predict the time consumption by that event and using HTML 5 component progress bar increasing its value using time interval and on completion setting its value to 100.

Demo of increasing HTML 5 value

Pratik Bhatt
  • 871
  • 1
  • 8
  • 21
  • Yes, but the aim of a progress bar is to be accurate, not to show some random values and then show 100% Better show only 0% 100% then. Thanks you anyway – Weacked Oct 05 '12 at 08:59