Log in

View Full Version : Help With This Script



robtruman
05-01-2008, 04:39 PM
What Im trying to accomplish is to have a splash page :( and have it check to see if the homepage is loaded and then redirect. This is on a dotnetnuke site.

I have found a script that should do this but Im not smart enough to set it up on the page and some guidance would be great.

Here is the script:

function loadFrame(iframeName, url) {
setTimeout("checkFrameState('hiddenframe')",500);
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}
else return true;
}

function checkFrameState(iframeName) {
var bLoaded;
if ( window.frames[iframeName] ) {
if (window.frames[iframeName].document.readyState=="complete")
bLoaded=true;
else
bLoaded=false;
}
else bLoaded=true;

if (bLoaded)
setTimeout("pageRedirect()",2000);
else
setTimeout("checkFrameState('hiddenframe')",500);
}

function pageRedirect() {
top.location = "default.aspx";
}


I need help in setting this up so it works on my site. Or if there is a better way to do this then I would love to here about it.

Thanks in advance