The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

displaying HTML/javascript  gif while generating a PDF.

Has anybody implemented a javascript or HTML based
Christopher Baus
Tuesday, October 12, 2004
 
 
Opps hit "ok" accidently. 

Anyway has anybody implemented a javascript/HTML wait gif while generating a PDF which takes about 20 seconds?  I think the only way to do this is to poll the server, but I'm undecided as to the best way to do this.  I suspect the solution will be fairly ugly.

Suggestions?
Christopher Baus
Tuesday, October 12, 2004
 
 
This topic doesn't seem publicly readable, but I thought I would post my solution in case it does become publically readable.

The solution is to use Javascript's forum.submit() functionality.  This takes advantage of a feature (quirk?) in most web browsers that delay displaying the submited page until the web server returns with a response.  Typically the screen is cleared when a new page is rendered.

Here's a simple page which does the dirty work:

<HTML>
<HEAD>
<TITLE>Generating PDF</TITLE>
</HEAD>
<BODY>
<center>
<h3>Generating PDF</h3>
<img align=middle src=wait.gif>
</center>
<FORM>
</FORM>
<script type="text/javascript">
document.forms[0].action="PDFURL?<%=request.getQueryString()%>";
document.forms[0].method="POST";
document.forms[0].submit();
</script>
</BODY>
</HTML>
Christopher Baus Send private email
Wednesday, October 13, 2004
 
 
There's also a way of detecting when all the images are loaded...  that may be another way of doing it.
KC Send private email
Friday, October 15, 2004
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz