I have an auto refresh script here, it works beautifully, but calling LoadPage via body onload blocks several other scripts on my pages. I’ve tried calling it through many other suggested alternatives to body onload, but nothing so far works. Here is the code:
<head>
<script>
var asdf = false;
function StartTime(){
if(asdf)clearTimeout(asdf)
asdf = setTimeout("RefreshPage()",15000);
}
function RefreshPage(){
clearTimeout(asdf)
if(document.autorl.RFCB.checked)
document.location.href = document.location.pathname + '?Checked'
}
function LoadPage(){
var findCheck = document.location.href.split("?Chec");
if(findCheck.length == 2){
document.autorl.RFCB.checked=true;
window.location='#bottom'
StartTime()
}
}
</script>
</head>
<body onload="LoadPage()">
<div>
<form name="autorl">
Auto-Refresh: <input type="checkbox" name="RFCB" onclick="StartTime()">
</form></div>
<a name="bottom">
Could anybody here lend a hand with this?
You could instead use something like the document.ready() handler in jQuery to accomplish this:
http://api.jquery.com/ready/