PDA

View Full Version : Page Preloader?



Phantom__
08-20-2006, 01:31 PM
I was wondering if there was a page preloader, not a image preloader but a preloader for the WHOLE page not for 1-2 images, i need it for my PHP portal because it takes a few to load it all. Thank u.

Twey
08-20-2006, 01:53 PM
You wish to preload the HTML of the page, yes?

You could try:
<script type="text/javascript">
function getHttpRequest() {
if(window.xhr) return window.xhr;
if(typeof ActiveXObject == "undefined" && typeof window.XMLHttpRequest == "undefined") return null;
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5) {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
}
@else xmlhttp = null;
@end @*/

if (xmlhttp == null && typeof window.XMLHttpRequest != 'undefined')
try {
xmlhttp = new window.XMLHttpRequest();
} catch (e) {
xmlhttp = null;
}
return (window.xhr = xmlhttp);
}

var x = getHttpRequest();
x.open('GET', 'portal.php', false);
x.send(null);
</script>That may or may not work, I'm not too sure :)