I'm trying to make a script that triggers a certain function after a date and time has passed. I have tried in all ways but I can not, always with some error or bug. My last test did so:
var time = '08/03/2014 23:45';
setInterval(function() {
if ( Date(time) <= Date() ) {
document.body.innerHTML += 'Ring ring! ♪♫ <br>';
}
}, 1000);
There is no problem if the function is fired whenever the time has passed and the time value should be the same as the example.