Hjælp til at sammensætte to scripts.
Hey er der nogen der lige kan hjælpe med disse to scripts.De virker fint når de køres hver for sig, men virker ikke sammen.
--> 1. Script
<script type="text/javascript">
function slaa() {
var hours, minutes, seconds;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {hours = "00:";}
else if (intHours < 24) {hours = intHours+":";}
if (intMinutes < 10) {minutes = "0"+intMinutes+":";}
else {minutes = intMinutes+":";}
if (intSeconds < 10) {seconds = "0"+intSeconds+" ";}
else {seconds = intSeconds+" ";}
timeString = hours+minutes+seconds;
man_ur.innerHTML = timeString;
window.setTimeout("slaa();", 100);
}
window.onload = slaa;
</script>
<span id="man_ur"> </span>
--> 2. Script
<script type="text/javascript">
var nTime = '<%Response.Write"60"%>'; // <-- Indskriv antal sekunder
function countDown() {
var nH = Math.floor(nTime/3600),
nRest = nTime%3600,
nM = Math.floor(nRest/60),
nS = nRest%60;
if (nM<10) nM = "0" + nM;
if (nS<10) nS = "0" + nS;
oTime.firstChild.nodeValue = (nH+":"+nM+":"+nS);
if (nTime==0) {
location.href='<%="test5.asp"%>';
} else {
nTime--;
setTimeout("countDown()", 1000);
}
}
var oTime = null;
window.onload = function() {
oTime = document.getElementById("timeDisplay");
countDown();
}
</script>
<span id="timeDisplay"> </span>
