Hi all,
I have a script that countdowns and then I call a new page in a new browser, however the line that calls the submit() function to load a new page produces a null object error in ie but works in firefox.
heres the code:
the window.document.frmBestSubmit.submit.click(); line fails in ie but not firefox, and it works nice in firefix and the form is submitted automatically.
I have a script that countdowns and then I call a new page in a new browser, however the line that calls the submit() function to load a new page produces a null object error in ie but works in firefox.
heres the code:
the window.document.frmBestSubmit.submit.click(); line fails in ie but not firefox, and it works nice in firefix and the form is submitted automatically.
Code:
script language="JavaScript">
//configure refresh interval (in seconds)
var countDownInterval=10;
//configure width of displayed text, in px (applicable only in NS4)
var c_reloadwidth=200
</script>
<ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>
<script>
var countDownTime=countDownInterval+1;
function countDown(){
countDownTime--;
if (countDownTime <=0){
countDownTime=countDownInterval;
clearTimeout(counter)
window.document.frmBestSubmit.submit.click();
window.location.reload("[URL unfurl="true"]http://www.ctremblay.com/TrillionCuts/TrillionCutsVoteAutomation.php?start=true")[/URL]
return
}
if (document.all) //if IE 4+
document.all.countDownText.innerText = countDownTime+" ";
else if (document.getElementById) //else if NS6+
document.getElementById("countDownText").innerHTML=countDownTime+" "
else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
document.c_reload.document.c_reload2.document.write('<span class="style1"><center>next submit in <b id="countDownText">'+countDownTime+' </b> seconds</center></span>')
document.c_reload.document.c_reload2.document.close()
}
counter=setTimeout("countDown()", 1000);
}
function startit(){
if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
document.write('<span class="style1"><center>next submit in <b id="countDownText">'+countDownTime+' </b> seconds</center></span>')
countDown()
}
if (document.all||document.getElementById)
startit()
else
window.onload=startit
</script>
Thanks for any tips
Chris