read only
ik heb nu deze code
maar ik wil dat hij 'read only' is en dat je de tijd niet kan weghalen.
kan iemand me daarbij helpen? En hoe kan ik doen dat hij een nieuwe pagina opent als hij klaar is?
bij voorbaat dank:)
<html>
<head>
<style>
#message {
color: #ff0000;
font-height: 40px;
}
</style>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
countdownInterval(
0, // UUR.
5, // MINUTEN
0 // SECONDEN
);
});
// globals
var dateObj = null;
var targetDateObj = null;
var timerObj = null;
function doCountdown() {
timerObj.setHours (targetDateObj.getHours() - dateObj.getHours());
timerObj.setMinutes (targetDateObj.getMinutes() - dateObj.getMinutes());
timerObj.setSeconds (targetDateObj.getSeconds() - dateObj.getSeconds());
displayFunction ();
if (
timerObj.getHours() == 0 &&
timerObj.getMinutes() == 0 &&
timerObj.getSeconds() == 0
) {
alertFunction();
return null;
}
dateObj.setSeconds(dateObj.getSeconds() + 1);
setTimeout("doCountdown()", 1000);
}
function countdownInterval(H, i, s) {
dateObj = new Date();
timerObj = new Date();
targetDateObj = new Date();
targetDateObj.setHours(dateObj.getHours() + H);
targetDateObj.setMinutes(dateObj.getMinutes() + i);
targetDateObj.setSeconds(dateObj.getSeconds() + s);
doCountdown();
}
function displayFunction () {
$('#count2').val(
"0"+
timerObj.getMinutes() +":"+
timerObj.getSeconds()
);
}
function alertFunction() {
// HIER KOMT DUS DE POPUP
$('#message').html('<a href=scoreberekenen.php>Einde wedstrijd</a>');
}
</script>
</head>
<body>
<input type="text" id="count2">
<div id="message"></div>
</body>
</html>
<input type="text" id="count2" readonly="readonly">
Nu ... weet wel: alles wat je op client niveau kan beschermen, kan die client overrulen
Trouwens ontzettend bedankt voor de reacties:) ik kan weer verder!