How to manage order of page loading...

by DavidO
3 replies
  • WEB DESIGN
  • |
I've got a jquery slideshow page that displays 8 external pages (slides) in an iframe. The page loads very slowly and I figure it's because it's loading all 9 pages before it displays the "parent" page.

How can I set this up so that it fully loads the parent page and slide 1 first? Then while the visitor is browsing the first page the rest of them can be loading in the background?

Would it be better to put all the content on one single page using a hide/show function?

I've googled this to death and all I've found is false leads. But there must be some way to do this.

Thanks for any suggestions!
#loading #manage #order #page
  • Profile picture of the author kcdaemon
    Hi,

    I am positive that, when using an iframe, nothing gets preloaded. AFAIK, you can't preload content in an iframe either, but it's easy enough to switch the 'src' of the iframe using javascript or jquery.

    If the pages in the iframe load slowly because of non-cached images, you can include a div at the end of your page that has these images included in it, but set the styling to "display: none;" with CSS. This way you "preload" the images for your visitor.
    If it's the actual website that is slow, I suggest you write a small php script that runs every x minutes or hours, fetches the page from the remote server and puts it local on your server so it can get accessed quickly.

    Hope that helps!
    /K
    {{ DiscussionBoard.errors[3251189].message }}
    • Profile picture of the author DavidO
      Thanks, /K

      I've tried your suggestion with the <div> holding the images. My understanding of this may be wrong, but it seems to me that this doesn't do what I'm hoping to achieve.

      By loading all the images with the first page, doesn't this mean it takes just as long to open? (the text content of the slides being minimal with very little effect on page loading)

      The one advantage it offers is that the subsequent pages will load more quickly... but this isn't my problem. I want the first page to load faster and not have to wait for the following pages to load also (if this is actually what is happening).
      {{ DiscussionBoard.errors[3251524].message }}
  • Profile picture of the author donnan
    Have you tried put the html from the page into a php file then call the php file into the iframe.

    You can include a function in the <body onload=loadpage();> of the html page that should pre load the 1st page for you.

    Of course you would also need the function to process the pre-loading. But I can't see why this shouldn't work.
    {{ DiscussionBoard.errors[3251550].message }}

Trending Topics