SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Where to get a "please wait" script?

    Hi,
    I've searched for this and can't find it anywhere. What I want is to display some message like "Please Wait" while my page loads with lots of form elements. Would be nice if it would darken the current page as well. My page is written in PHP. Any idea where I can get such a script?
    Thanks,
    B.

  2. #2
    SitePoint Evangelist Ed Seedhouse's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, B.C. Canada
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bearaman View Post
    Hi,
    I've searched for this and can't find it anywhere. What I want is to display some message like "Please Wait" while my page loads with lots of form elements. Would be nice if it would darken the current page as well. My page is written in PHP. Any idea where I can get such a script?
    Madness! A message asking people to wait will just drive them away! If you can't make a design that loads within a couple of seconds then you have no business designing.
    Ed Seedhouse

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Although harshly worded, I agree with Ed's conclusion. You may as well put up a 'Please go away' notice as a 'Please wait' notice.

    This would have to be done with JavaScript, since the PHP script runs on the server and cannot interact with the page once it reaches the visitor's browser (assuming he or she is patient enough to wait for it).

    Moved to the JavaScript forum.
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2008
    Location
    Dublin, Ireland
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    While I agree with the sentiment I've had to deal with situations where it's beyond my control. I developed an internal system that was fine and quick but then it had to be made available to a group of people who only had access to the web not our internal network. Their web access was quite frankly appalling. They would be waiting up to a minute for even google to open. So I basically had to give them a version with a please wait in the middle of the page which script would remove when the page had loaded. So sue me. I used something similar to lightbox. i.e. the overlay with a please wait animated gif as the image and the difference being this was then removed when the page had loaded not part of an image viewing service.

    We all aim to produce the best and most efficient code we can but sometimes other factors are beyond our control. Of course I could have given them a blank page. Would have loaded in a snip and by Ed's criteria I would then be allowed to be in the business of designing (although I call it developing).

  5. #5
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. All I'm talking about is something to display for 2-3 seconds while a page renders, no more than that. Thanks for the link Brian.
    B.

  6. #6
    SitePoint Zealot Luke Morton's Avatar
    Join Date
    Jul 2005
    Location
    Essex, England.
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds a bit pointless to have a please wait. Please wait messages are probably neccessary for AJAX type form submissions and other AJAXie things, however I think the average waiting time a general user for a page to load before getting bored and going elsewhere is 10 seconds. Why add JavaScript, which could end up increasing your loading time when your page only takes 2-3 seconds to load.

    For use with AJAX it is helpful to inform the user of the progress of the request since a normal internet user would not know when the AJAX request had been completed. However if you have a page which you just wish to show a loading sign before your page loads it seems a bit crazy to me. People dislike waiting around, especially when you rub it in their faces.

    Also there are accessibility and usability issues with using JavaScript unneccessarily. Be wise when adding to user experience, since you might be causing more harm than good.
    Luke Morton
    UK Web Explorer| lukemorton.co.uk

  7. #7
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <body>
    <div id="pest" style="position:absolute;width:100&#37;;height:100%;background-color:green;">Wait...</div>
    ...stuff...
    </body>
    <script>document.getElementById('pest').style.display = 'none';</script>
    I think this is a bad idea. It would be better to design the html/css in a way which will display progressively, so that they can start viewing parts of the page as they get rendered. The user will understand that thier internet connections sucks and the page is loading.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •