Anyone know a way to control a variable in JavaScript in real time?
I'm implementing a code that in the face of automatic requests (signatures via pad) at some point when it arrives at the last signature must bring up a button (previously in hidden). The code of activate/disactivate is follow:
function checkButton() {
var test = ClientInformation.WorkstepFinishCurrentlyAllowed;
if (test == false) {
$("#btnCustomFinish").addClass("hidden");
} else {
$("#btnCustomFinish").removeClass("hidden");
}
}
I tried a solution using a setInterval () function that runs a check every few seconds but I do not find it very efficient.
setInterval(function() {
checkButton();
}, 500);
Does anyone know how to implement it through events, so that he is performing?
If necessary, use some code that automatically checks the variation in the value of the variables?
Regards