[Javascript] Show a progress bar while waiting for a download to begin?
Frank Arensmeier
frank.arensmeier at nikehydraulics.se
Fri Jun 9 09:31:03 CDT 2006
Hello Steve.
As a matter of fact, I thought about your approach already. I mean
this would be better than nothing at all. And thank you for the link
you provided.
> As for your problem, when the download page reloads, wouldn't the
> progress
> bar just go away?
The problem is that the download page doesn't reload. At least not in
Safari. I am not sure if other browsers handle this differently. This
is what happens when a user clicks on a link:
1) The user clicks on a download link to a document which actually
doesn't exist.
2) The PDF document is generated
3) The PHP script will send a application/octet stream header
4) The script outputs the PDF document.
5) The script sends a redirect header to the referring page (= the
download page)
I will send you a link to the page to your private adress. Because
the site has not been released yet, I will rather not publish a link
to the testing server on the Internet.
/frank
9 jun 2006 kl. 14.57 skrev Steve Clay:
> Friday, June 9, 2006, 3:23:04 AM, Frank Arensmeier wrote:
>> All scripts for progress bars I found on Google are dealing with the
>> problem that is when a user is waiting for a page to load completely
>> (most of them using the "onLoad" event in the body tag). Waiting for
>> a download to begin seems to be a different problem.
>
> Unless your backend gives you access to its generation progress (or
> even if
> it does), I recommend faking it. Create a DIV that stretches with
> time but
> continuously slowing:
>
> http://mrclay.org/js/transition/fake_progress.html
> This uses a simple animation library I worked on a few months ago.
> 1. t = new Transition(lengthOfTimeInMs, desiredFps);
> 2. attach elements/frame functions/an end function to t.
> 3. t.begin();
>
> Aside: I don't know why, but setInterval doesn't seem too accurate
> in Opera
> and IE (a 10s transition takes around 13s), but FF1.x is right on
> the money.
>
> As for your problem, when the download page reloads, wouldn't the
> progress
> bar just go away?
>
> Steve
> --
> http://mrclay.org/
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
More information about the Javascript
mailing list