SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast johanna0507's Avatar
    Join Date
    Nov 2006
    Location
    London, England
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Display something while the page is loading?

    Hi
    I run Wordpress and I feel that the content sometimes takes a while to load. I would like to display some very basic background while the page is loading (i.e for a 1-5 seconds as required).

    I remember hearing about this type of functionality and I am sure that there is an event for 'on load' or something like that.

    Not sure whether to use PHP, HTML or javascript. I want to avoid javascript. PHP is ok but HTML would be best.

    Please can you help me with advice?

  2. #2
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do a search for 'proloader', though unless you are serving up flash or graphics (like a photo-gallery), it shouldn't really be necessary :-)

    nadia

  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)
    From your description, I guess you use tables for layouts? This is one of the disadvantages of that ancient practice. By using semantic markup and having CSS to control the presentation, the page will render incrementally. The total load time may be the same, but it will appear much more responsive to the viewer. And you don't have to put up an annoying 'please wait' message, which can often be the same as 'please leave'. (At least for me.)
    Birnam wood is come to Dunsinane

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    page load

    I notice that my WordPress blog takes a while to load in as well. Amazingly enough it doesn't use tables for layout.
    The theme I'm using (thirteen) has an image folder with a total of 142 KB
    It doesn't seem like that much, but I notice once the images are cached the page does reload a lot faster. I'm not sure if the images could be optimized as I haven't bothered to worry about it yet.

  5. #5
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Maybe you can try using ob_flush() followed by flush().

  6. #6
    SitePoint Member costin_trifan's Avatar
    Join Date
    Apr 2007
    Location
    Romania
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check the lowsrc image attr.
    If included, it will display a low resolution image until your image has been fully downloaded.

    <img lowsrc="a small picture to load before" src="your original picture" />

    This is an old css trick for fast loading pages.

  7. #7
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no such thing as 'lowsrc' in the W3C specs. Do not use it.


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
  •