How do I warn my users that a given Zope page will take a long time to load? Is there any way to load a preliminary "please wait this may take a while" page while the user waits for the real page to load? -- Ed Goppelt
On Monday 19 November 2001 02:39 pm, Edmund Goppelt allegedly wrote:
How do I warn my users that a given Zope page will take a long time to load? Is there any way to load a preliminary "please wait this may take a while" page while the user waits for the real page to load?
The only way I know of is to use Javascript (although there may be a RESPONSE header you can set). Use something like this as the page with the wait message: <dtml-var standard_html_header> <h2><dtml-var title_or_id> <dtml-var document_title></h2> <p> This might take a while... </p> <script type="text/javascript"> location.href='http://server/slow_page'; </script> <dtml-var standard_html_footer> of course that assumes javascript is turned on. What you can do to make sure it still works without it is to write the original link with javascript and include a <noscript> tag with a link directly to slow_page. hth, /---------------------------------------------------\ Casey Duncan, Sr. Web Developer National Legal Aid and Defender Association c.duncan@nlada.org \---------------------------------------------------/
Another way that I use: Use two frames. When the form is submitted, write your message into the second frame, which is also to be the target of the form. When the data is ready, it will replace the message. Of course this method uses frames and javascript, but it works fine. Tom P [Casey Duncan]
How do I warn my users that a given Zope page will take a long time to load? Is there any way to load a preliminary "please wait this may take a while" page while the user waits for the real page to load?
The only way I know of is to use Javascript (although there may be a RESPONSE header you can set). Use something like this as the page with the wait message: <dtml-var standard_html_header> <h2><dtml-var title_or_id> <dtml-var document_title></h2> <p> This might take a while... </p> <script type="text/javascript"> location.href='http://server/slow_page'; </script> <dtml-var standard_html_footer> of course that assumes javascript is turned on. What you can do to make sure it still works without it is to write the original link with javascript and include a <noscript> tag with a link directly to slow_page.
On Mon, Nov 19, 2001 at 03:52:14PM -0500, Casey Duncan wrote:
On Monday 19 November 2001 02:39 pm, Edmund Goppelt allegedly wrote:
How do I warn my users that a given Zope page will take a long time to load? Is there any way to load a preliminary "please wait this may take a while" page while the user waits for the real page to load?
The only way I know of is to use Javascript (although there may be a RESPONSE header you can set). Use something like this as the page with the wait message:
<dtml-var standard_html_header> <h2><dtml-var title_or_id> <dtml-var document_title></h2> <p> This might take a while... </p> <script type="text/javascript"> location.href='http://server/slow_page'; </script> <dtml-var standard_html_footer>
of course that assumes javascript is turned on. What you can do to make sure it still works without it is to write the original link with javascript and include a <noscript> tag with a link directly to slow_page.
A better way is to use the HTTP Refresh header. Remove the Javascript from the above example, and add: <dtml-call "REQUEST.addHeader('Refresh', '0;URL=http://server/slow_page')"> This will cause the browser to load the slow page URL right after it received this page. -- Martijn Pieters | Software Engineer mailto:mj@zope.com | Zope Corporation http://www.zope.com/ | Creators of Zope http://www.zope.org/ ---------------------------------------------
On Mon, Nov 19, 2001 at 04:07:59PM -0500, Martijn Pieters wrote:
A better way is to use the HTTP Refresh header. Remove the Javascript from the above example, and add:
<dtml-call "REQUEST.addHeader('Refresh', '0;URL=http://server/slow_page')">
This is a sweet solution (I'm guessing you meant to write "RESPONSE.addHeader...") The only thing I don't like about it is that the user cannot use his browser's back button without becoming "trapped". When he hits the back button, the "please wait" page is loaded which immediately redirects him to the page he was just on (i.e. the slow page). Is there some way to remove the "please wait" page from the Browser's history list so that the Back button works as expected? -- Ed Goppelt
On Tue, Nov 20, 2001 at 12:19:14PM -0500, Edmund Goppelt wrote:
On Mon, Nov 19, 2001 at 04:07:59PM -0500, Martijn Pieters wrote:
A better way is to use the HTTP Refresh header. Remove the Javascript from the above example, and add:
<dtml-call "REQUEST.addHeader('Refresh', '0;URL=http://server/slow_page')">
This is a sweet solution (I'm guessing you meant to write "RESPONSE.addHeader...") The only thing I don't like about it is that the user cannot use his browser's back button without becoming "trapped". When he hits the back button, the "please wait" page is loaded which immediately redirects him to the page he was just on (i.e. the slow page). Is there some way to remove the "please wait" page from the Browser's history list so that the Back button works as expected?
Only with javascript, and then only with browsers that support the extension (for which you can test). You can use window.location.replace() to replace the current URL with another, which causes the currentl url to be removed from the hbrowser history. -- Martijn Pieters | Software Engineer mailto:mj@zope.com | Zope Corporation http://www.zope.com/ | Creators of Zope http://www.zope.org/ ---------------------------------------------
On Wednesday 21 November 2001 07:37, Martijn Pieters wrote:
On Tue, Nov 20, 2001 at 12:19:14PM -0500, Edmund Goppelt wrote:
On Mon, Nov 19, 2001 at 04:07:59PM -0500, Martijn Pieters wrote:
A better way is to use the HTTP Refresh header. Remove the Javascript from the above example, and add:
<dtml-call "REQUEST.addHeader('Refresh', '0;URL=http://server/slow_page')">
This is a sweet solution (I'm guessing you meant to write "RESPONSE.addHeader...") The only thing I don't like about it is that the user cannot use his browser's back button without becoming "trapped". When he hits the back button, the "please wait" page is loaded which immediately redirects him to the page he was just on (i.e. the slow page). Is there some way to remove the "please wait" page from the Browser's history list so that the Back button works as expected?
Only with javascript, and then only with browsers that support the extension (for which you can test). You can use window.location.replace() to replace the current URL with another, which causes the currentl url to be removed from the hbrowser history.
Have you searched the mailing list archives for REPONSE.write ??? This way you can write status messages without disruption. No need for Javascript, but: You could as well send Javascript :-) hth, Danny
On Mon, 2001-11-19 at 20:52, Casey Duncan wrote:
On Monday 19 November 2001 02:39 pm, Edmund Goppelt allegedly wrote:
How do I warn my users that a given Zope page will take a long time to load? Is there any way to load a preliminary "please wait this may take a while" page while the user waits for the real page to load?
The only way I know of is to use Javascript (although there may be a RESPONSE header you can set).
There is: <META HTTP-EQUIV="Refresh" CONTENT="3;URL=very_slow_page_html"> Add it to the <head> section of the please wait page. The 3 is how soon after the redirect should happen so you'll probably want to use 0. Cheers, Matt
[Matt Goodall]
On Mon, 2001-11-19 at 20:52, Casey Duncan wrote:
On Monday 19 November 2001 02:39 pm, Edmund Goppelt allegedly wrote:
How do I warn my users that a given Zope page will take a long time to load? Is there any way to load a preliminary "please wait this may take a while" page while the user waits for the real page to load?
The only way I know of is to use Javascript (although there may be a RESPONSE header you can set).
There is:
<META HTTP-EQUIV="Refresh" CONTENT="3;URL=very_slow_page_html">
Add it to the <head> section of the please wait page. The 3 is how soon after the redirect should happen so you'll probably want to use 0.
I was going to suggest this as well, but I realized I wasn't sure how to get the form data to very_slow_page.html. I guess the original responding page could write it into the meta tag URL attribute, if it were suitable for a GET rather than a POST. Tom P
participants (6)
-
Casey Duncan -
Danny William Adair -
Edmund Goppelt -
Martijn Pieters -
Matt Goodall -
Thomas B. Passin