Controlling the loading sequence of page components

2 replies
  • WEB DESIGN
  • |
What i want to do is to control the loading order of images, js files, or css files so that the page would be displayed properly.
In my page there are some pictures being loaded in the beginning but they are too big - which makes other images wait for a along time for their turn - and they are not necessary to be loaded in the beginning, while there are images that i need them to be loaded before the others.
same for css files. Sometimes they are loaded late and the page look all corrupted untill they are loaded.
Can anyone provide a solution for this problem.
#components #controlling #loading #page #sequence
  • Profile picture of the author Mark Brian
    The first images declared in your HTML document will be loaded first and so on... If you want to prioritize images declare them first and then use CSS to control their display position.
    Signature

    {{ DiscussionBoard.errors[3606187].message }}
  • Profile picture of the author SteveJohnson
    Originally Posted by coykiesaol View Post

    What i want to do is to control the loading order of images, js files, or css files so that the page would be displayed properly.
    In my page there are some pictures being loaded in the beginning but they are too big - which makes other images wait for a along time for their turn - and they are not necessary to be loaded in the beginning, while there are images that i need them to be loaded before the others.
    same for css files. Sometimes they are loaded late and the page look all corrupted untill they are loaded.
    Can anyone provide a solution for this problem.
    #1, make sure you aren't using tables for your page layout.

    #2, specify height and width in the image tag. The browser will allocate the space and build the page while the image is loading instead of having to wait to determine the image size.

    There's very little you can do to control the load sequence. Page elements don't load on a single HTTP connection. HTTP specs allow for up to 4 simultaneous connections - as one request completes, another is made. So you could have one large file using one request, while the other 3 are busy loading little images.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3611735].message }}

Trending Topics