heres a script i pasted together from other sources; it works ( yes isnt that amazing) but what i need is a way to convert the seconds to minutes and seconds to be displayed to the user. i know its done with math but i cant really figure it out in .js
can someone PLEASE help me to do this?
besides you get the used of a wonderful timed redirect script thats not embedded in a form and is cross browser tested.
heres the script
<script language="JavaScript">
//Redirect without form-tag page script
//change below target URL to desired place
var targetURL="http://www.cnn.com"
//configure redirect time (in seconds)
var countDownInterval=1800;
//configure width of displayed text, in px (applicable only in NS4.x)
var c_redirectwidth=200
</script>
<ilayer id="c_redirect" width=&{c_redirectwidth}; ><layer id="c_redirect2" width=&{c_redirectwidth}; left=0 top=0 z-index:3></layer></ilayer>
<script>
var countDownTime=countDownInterval+1;
function countDown(){
countDownTime--;
if (countDownTime <=0){
countDownTime=countDownInterval;
clearTimeout(counter)
window.location=targetURL
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){ //TEXT FOR NS4.x
document.c_redirect.document.c_redirect2.document.write('Next redirect in <b id="countDownText">'+countDownTime+' </b> seconds')
document.c_redirect.document.c_redirect2.document.close()
}
counter=setTimeout("countDown()", 1000);
}
function startit(){
if (document.all||document.getElementById) //TEXT FOR IE
document.write('Next redirect in <b id="countDownText">'+countDownTime+' </b> seconds')
countDown()
}
if (document.all||document.getElementById)
startit()
else
window.onload=startit
</script>
<!--end countdown script -->
can someone PLEASE help me to do this?
besides you get the used of a wonderful timed redirect script thats not embedded in a form and is cross browser tested.
heres the script
<script language="JavaScript">
//Redirect without form-tag page script
//change below target URL to desired place
var targetURL="http://www.cnn.com"
//configure redirect time (in seconds)
var countDownInterval=1800;
//configure width of displayed text, in px (applicable only in NS4.x)
var c_redirectwidth=200
</script>
<ilayer id="c_redirect" width=&{c_redirectwidth}; ><layer id="c_redirect2" width=&{c_redirectwidth}; left=0 top=0 z-index:3></layer></ilayer>
<script>
var countDownTime=countDownInterval+1;
function countDown(){
countDownTime--;
if (countDownTime <=0){
countDownTime=countDownInterval;
clearTimeout(counter)
window.location=targetURL
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){ //TEXT FOR NS4.x
document.c_redirect.document.c_redirect2.document.write('Next redirect in <b id="countDownText">'+countDownTime+' </b> seconds')
document.c_redirect.document.c_redirect2.document.close()
}
counter=setTimeout("countDown()", 1000);
}
function startit(){
if (document.all||document.getElementById) //TEXT FOR IE
document.write('Next redirect in <b id="countDownText">'+countDownTime+' </b> seconds')
countDown()
}
if (document.all||document.getElementById)
startit()
else
window.onload=startit
</script>
<!--end countdown script -->
Comment