PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > "please wait" type page without javascript?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
"please wait" type page without javascript?

Réponse
 
LinkBack Outils de la discussion
Vieux 16/02/2008, 23h48   #1
Jeremy@thebunnyshed.co.uk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut "please wait" type page without javascript?

Hi all,

I have database actions that will potentially take several seconds to
complete.

My normal page uses AJAX so keeping the user informed of what is
happening is not a problem.

However, the page also has fallback code in case of no Javascript. In
this case I would like to display temporary "please wait" type page
whilst the DB search is taking place.

I originally thought I would serve up the wait page, and then use meta
refresh to immediately request the page that actually does the search.
That way the wait page would be displayed as long as the search took
to complete and markup was returned to the browser.

However, on reading up about meta refresh, it appears this is now
depreciated, and is frowned upon anyway as it messes up the Back
button.

So, do I?
1) Do it anyway
2) Forget the waiting page, and just load the search page direct
3) Use some other friendlier method to keep the user informed (Not
that I can think of any)

Cheers,
Jeremy
  Réponse avec citation
Vieux 17/02/2008, 01h23   #2
petersprc
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: "please wait" type page without javascript?

Hi,

You can have a warning for restricted browsers if it's say under 10
seconds or so:

<noscript>
<p style="color: red;">Warning: This operation may take several
seconds. Please do not
close your web browser during this operation. Note: Enable
JavaScript
to remove this warning.</h1>
</noscript>

Regarding the back button, some browsers will skip over the meta
refresh page when traversing the history so in that case it wouldn't
be a problem. Even if that doesn't happen, if the refresh interval
isn't too short, the user will still be able to go back without much
difficulty.

On Feb 16, 6:48 pm, Jer...@thebunnyshed.co.uk wrote:
> Hi all,
>
> I have database actions that will potentially take several seconds to
> complete.
>
> My normal page uses AJAX so keeping the user informed of what is
> happening is not a problem.
>
> However, the page also has fallback code in case of no Javascript. In
> this case I would like to display temporary "please wait" type page
> whilst the DB search is taking place.
>
> I originally thought I would serve up the wait page, and then use meta
> refresh to immediately request the page that actually does the search.
> That way the wait page would be displayed as long as the search took
> to complete and markup was returned to the browser.
>
> However, on reading up about meta refresh, it appears this is now
> depreciated, and is frowned upon anyway as it messes up the Back
> button.
>
> So, do I?
> 1) Do it anyway
> 2) Forget the waiting page, and just load the search page direct
> 3) Use some other friendlier method to keep the user informed (Not
> that I can think of any)
>
> Cheers,
> Jeremy


  Réponse avec citation
Vieux 17/02/2008, 07h15   #3
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: "please wait" type page without javascript?

..oO(Jeremy@thebunnyshed.co.uk)

>I have database actions that will potentially take several seconds to
>complete.
>
>My normal page uses AJAX so keeping the user informed of what is
>happening is not a problem.
>
>However, the page also has fallback code in case of no Javascript. In
>this case I would like to display temporary "please wait" type page
>whilst the DB search is taking place.
>
>I originally thought I would serve up the wait page, and then use meta
>refresh to immediately request the page that actually does the search.
>That way the wait page would be displayed as long as the search took
>to complete and markup was returned to the browser.
>
>However, on reading up about meta refresh, it appears this is now
>depreciated, and is frowned upon anyway as it messes up the Back
>button.


It's not deprecated and most likely never will, because it has its valid
uses. The reason why it's usually frowned upon is that it's abused for
redirects too often, which is ugly enough on its own (redirects should
be done with proper HTTP headers), but becomes even worse if it's done
immediately with no delay. This breaks the back button.

But it's perfectly fine if used for what it was intended - to _refresh_
a page after a certain amount of time. This could be a live ticker for
example, which refreshes every 30s, or also a page reporting the status
of a currently running server process like in your case. IMHO there's
nothing wrong with that. Just don't refresh every 2 seconds, there
should be a bit more time. At least 10s IMHO, which is still good and
accurate enough for a fallback.

Micha
  Réponse avec citation
Vieux 17/02/2008, 12h15   #4
Jeremy@thebunnyshed.co.uk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: "please wait" type page without javascript?

> But it's perfectly fine if used for what it was intended - to _refresh_
> a page after a certain amount of time. This could be a live ticker for
> example, which refreshes every 30s, or also a page reporting the status
> of a currently running server process like in your case. IMHO there's
> nothing wrong with that. Just don't refresh every 2 seconds, there
> should be a bit more time. At least 10s IMHO, which is still good and
> accurate enough for a fallback.


I think you misunderstand my intent. The meta refresh would be used to
open a new page immediately and once only.
ie:
.. Display wait page which contains immediate meta refresh
.. Browser honours meta refresh and requests search results
.. wait page is still displayed while search in progress, since no
markup has yet been returned from server.
.. Search finishes and page is displayed.

I guess I could stick in a 1 second delay to preserve the back
button, but this is getting ugly IMO. It forces a 1 second wait even
if the search is instantaneous.


I have been wondering whether it would be possible to scrap the
seperate wait page, and just have the search page return some "please
wait" markup immediately, and then have the eventual result markup
hide the wait markup using CSS? Anyone tried this?
  Réponse avec citation
Vieux 17/02/2008, 15h28   #5
Betikci Boris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: "please wait" type page without javascript?

On Feb 17, 1:48 am, Jer...@thebunnyshed.co.uk wrote:
> Hi all,
>
> I have database actions that will potentially take several seconds to
> complete.
>
> My normal page uses AJAX so keeping the user informed of what is
> happening is not a problem.
>
> However, the page also has fallback code in case of no Javascript. In
> this case I would like to display temporary "please wait" type page
> whilst the DB search is taking place.
>
> I originally thought I would serve up the wait page, and then use meta
> refresh to immediately request the page that actually does the search.
> That way the wait page would be displayed as long as the search took
> to complete and markup was returned to the browser.
>
> However, on reading up about meta refresh, it appears this is now
> depreciated, and is frowned upon anyway as it messes up the Back
> button.
>
> So, do I?
> 1) Do it anyway
> 2) Forget the waiting page, and just load the search page direct
> 3) Use some other friendlier method to keep the user informed (Not
> that I can think of any)
>
> Cheers,
> Jeremy


If AJAX has an essential function in your code, you should control
user agent "get_browser(null,true);" if [javascript] => 1 i think you
might reject the client request and demand javascript activation...
  Réponse avec citation
Vieux 17/02/2008, 15h35   #6
Betikci Boris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: "please wait" type page without javascript?

On Feb 17, 1:48 am, Jer...@thebunnyshed.co.uk wrote:
> Hi all,
>
> I have database actions that will potentially take several seconds to
> complete.
>
> My normal page uses AJAX so keeping the user informed of what is
> happening is not a problem.
>
> However, the page also has fallback code in case of no Javascript. In
> this case I would like to display temporary "please wait" type page
> whilst the DB search is taking place.
>
> I originally thought I would serve up the wait page, and then use meta
> refresh to immediately request the page that actually does the search.
> That way the wait page would be displayed as long as the search took
> to complete and markup was returned to the browser.
>
> However, on reading up about meta refresh, it appears this is now
> depreciated, and is frowned upon anyway as it messes up the Back
> button.
>
> So, do I?
> 1) Do it anyway
> 2) Forget the waiting page, and just load the search page direct
> 3) Use some other friendlier method to keep the user informed (Not
> that I can think of any)
>
> Cheers,
> Jeremy


<meta http-equiv='refresh' content='10'> Refreshes the page after 10
seconds

<?php
..
...
....
if(isset($_SESSION['redirect_time']))
{
$_SESSION['redirect_time']=0;
echo "<meta http-equiv='refresh' content='10'>";
$_SESSION['redirect_time']++;
}
else if($_SESSION['redirect_time']>0)
{?>window.redirect("go.html");
<?php}
?>
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h04.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15553 seconds with 14 queries