如何获得ajax事件的当前加载百分比? [重复]

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.

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