Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

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 11-14-2011, 05:27 AM   PM User | #1
cancer10
Regular Coder

 
Join Date: Jun 2006
Location: India
Posts: 792
Thanks: 210
Thanked 2 Times in 2 Posts
cancer10 can only hope to improve
Question jquery percentage completion

Hi

When making an AJAX call using jQuery, is it possible to know how much percentage has been completed so far?

For example: 25%, 50% or 100%?
__________________
http://outlineme.com/cancer10
cancer10 is offline   Reply With Quote
Old 11-15-2011, 12:20 AM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
No. The browser doesn't know how the total size of the response while receiving it.
__________________
.My new Javascript tutorial site: http://reallifejs.com/
.Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
.Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback
venegal is offline   Reply With Quote
Users who have thanked venegal for this post:
cancer10 (11-15-2011)
Old 11-15-2011, 02:17 AM   PM User | #3
cancer10
Regular Coder

 
Join Date: Jun 2006
Location: India
Posts: 792
Thanks: 210
Thanked 2 Times in 2 Posts
cancer10 can only hope to improve
There must be some way because when you login to gmail, it shows a progressbar and increments the value of the meter according to the objects / elements rendered in the browser.
__________________
http://outlineme.com/cancer10
cancer10 is offline   Reply With Quote
Old 11-15-2011, 02:31 AM   PM User | #4
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Quote:
Originally Posted by cancer10 View Post
Hi

When making an AJAX call using jQuery, is it possible to know how much percentage has been completed so far?

For example: 25%, 50% or 100%?
Quote:
Originally Posted by cancer10
There must be some way because when you login to gmail, it shows a progressbar and increments the value of the meter according to the objects / elements rendered in the browser.
Are you sure gmail is using AJAX at that stage?
webdev1958 is offline   Reply With Quote
Old 11-15-2011, 02:36 AM   PM User | #5
cancer10
Regular Coder

 
Join Date: Jun 2006
Location: India
Posts: 792
Thanks: 210
Thanked 2 Times in 2 Posts
cancer10 can only hope to improve
If there is a mechanism to do this, it can be done using AJAX as well.
__________________
http://outlineme.com/cancer10
cancer10 is offline   Reply With Quote
Old 11-15-2011, 03:20 AM   PM User | #6
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Quote:
If there is a mechanism to do this, it can be done using AJAX as well.
ok, then since there are plenty of examples on the www showing how to build progress bars (both client and server side), pick one and see if you can get it to work with AJAX since you are so sure it can be done.
webdev1958 is offline   Reply With Quote
Old 11-15-2011, 03:35 AM   PM User | #7
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
Quote:
Originally Posted by cancer10 View Post
There must be some way because when you login to gmail, it shows a progressbar and increments the value of the meter according to the objects / elements rendered in the browser.
The only two things you can do that will work in all browsers is split your request up into several smaller ones, so you can monitor how many of those have come back already, or regularly poll the server for a progress report. Whether any of those add to the user experience is doubtful.

If you don't care about browser compatibility, there are several ways. If you make your server send a Content-Length header, so the browser actually knows what to expect, you can use the onprogress event of the XMLHttpRequest, if supported, or readystate 3, if supported.
__________________
.My new Javascript tutorial site: http://reallifejs.com/
.Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
.Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback
venegal is offline   Reply With Quote
Users who have thanked venegal for this post:
cancer10 (11-15-2011)
Old 11-15-2011, 07:13 AM   PM User | #8
cancer10
Regular Coder

 
Join Date: Jun 2006
Location: India
Posts: 792
Thanks: 210
Thanked 2 Times in 2 Posts
cancer10 can only hope to improve
Quote:
Originally Posted by webdev1958 View Post
ok, then since there are plenty of examples on the www showing how to build progress bars (both client and server side), pick one and see if you can get it to work with AJAX since you are so sure it can be done.
Yes there are scripts but they do not contain the logic that actually tells how much time is remaining or task completed.
__________________
http://outlineme.com/cancer10
cancer10 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 12:34 PM.


Advertisement
Log in to turn off these ads.