Log in

View Full Version : Javascript Page Preloading



Decode
16-01-2008, 07:11 PM
Is it possible? ive seen it done with images, but can you do it with a whole page? If you can please post how to do it below.

Thanks,
Tom

kk.
16-01-2008, 07:15 PM
what do you mean it loads the whole page before it shows it? if so then i would like to know too :)

Decode
16-01-2008, 07:18 PM
what do you mean it loads the whole page before it shows it? if so then i would like to know too :)
Yes, where you go to 1 page and there is a javascript code on that page which loads the other page, so when you visit that page, it loads almost instantly. :)

Forge
16-01-2008, 07:25 PM
1. rename your sites homepage to home.php
2. make index.php a redirect page page
3. insert a hidden div into the redirection page which contains your sites code
4. make it redirect to your site in say 5 seconds?

Its an idea! :P

MrCraig
16-01-2008, 09:11 PM
Um, you can do it with an AJAX updater in scriptaculous.

Just include the scriptaculous files, then add this to your head sect.



<script type="text/javascript">
<!--
function load(url)
{
document.getElementById("Div ID to load into").innerHTML = "Loading...";
new Ajax.Updater('Div ID to load into',url);
}
//-->
</script>


Then use the javascript:load('URL to page'); as your links to a page.

php.net
16-01-2008, 10:06 PM
So not a preloader, but more of an instant loader? EG, when you visit the site for the first time it would take a tad longer to load the other files, then when you navigate them they pop straight up?

If that's what you mean I'll dig deep and hopefully produce something.

Want to hide these adverts? Register an account for free!