INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Percent loader slow to intialise in FF / Chrome, works perfectly in IE

Percent loader slow to intialise in FF / Chrome, works perfectly in IE

Percent loader slow to intialise in FF / Chrome, works perfectly in IE

(OP)
Hi,

I'm using the following progress percentage loader widget : http://widgets.better2web.com/loader/

I initialise it with

CODE

// initialise progress meter
initMeter('progressMeter',150);

function initMeter(id,size)
{
    // initialise upload meter
    uploader = $('#'+id).percentageLoader({width: size, height: size, controllable : false, progress : 0.5});
    uploader.setProgress(0);
    uploader.setValue('0'+sizeUnit);
} 

And I have a callback function for progress update via the XHR2 progress EventListener when submitting the file upload via AJAX / FormData

CODE

function showProgress(e)
{
    var loaded;
    
    if(e.lengthComputable)
    {
        if(sizeUnit == 'MB')
        {
            loaded = (Math.round(e.loaded * 100 / (1024 * 1024)) / 100);
        }
        else
        {
            loaded = (Math.round(e.loaded * 100 / 1024) / 100);
        }        
        
         uploader.setProgress(loaded / fileSize);
         uploader.setValue(loaded.toString() + sizeUnit);

    }
} 

When the meter loads in IE, I see the gauge image and the progress moving along with the percentage loaded in the middle and the amount of KB/MB processed at the bottom, works exactly as desired.

However, when viewing in FF/Chrome, I see the gauge image and the progress moving, but the centre percentage and the number of KB/MB uploaded takes a few seconds to show on large files, and for small files, it finishes uploading before the gauge information is even displayed?

Why is FF/Chrome taking so long to initialise the widget information?

Your input is appreciated.

1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: Percent loader slow to intialise in FF / Chrome, works perfectly in IE

interesting question. can you provide a link to a site you have this set up on?

one immediate thought: have you normalised the box model between browsers?
another is that if there is an issue it may be related to the value of e.lengthComputable. try putting some footprinting around that.

RE: Percent loader slow to intialise in FF / Chrome, works perfectly in IE

(OP)
I believe this was a timing issue, as I was calling AJAX to upload the FormData immediately after calling the initMeter function all from within the sendForm function

So I moved the initMeter call to the $(on.submit) of the form, which then calls the sendForm function which starts the AJAX upload and callback for progress, all seems to be working fine.

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close