I've inherited the task of creating a web page for my dept. application on the intranet. My experience with javascript is limited and would rather do this via PHP (v 4.3 at work), but javascript is what I've to work with.
Once a week we run migration (Oracle) at a specific time. What I'm trying to do is disable the links on the page when said time is reached. I already have a function that can toggle between the two, however a new page appears when it's triggered.
Is there any way possible to toggle on the same page?
Here is my test code...
(function() {
var state = null;
(function loop() {
var now = new Date();
var day = now.getDay();
var min = 60 * now.getHour() + now.getMinutes();
var disable = (day === 3 && (min >= 600 && min < 630));
if (disable !== state) {
if (disable) {
// call your disable code
} else {
// call your enable code
}
}
state = disable;
setTimeout(loop, 1000);
})();
})();