Good, I am created a function that verifies the state of a global variable, this variable must be constantly verifying it to know if I change its value. The idea is that call this function and that it can return for example an event of type success()
, para saber cuando termino la llamada o en este caso, cuando cambio de valor la variable
.
function verificar() {
var interval = setInterval(function () {
if (oXMLHTTP.readyState == 4) {
//CREAR NUEVO EVENTO
}
}, 1000);
}
verificar().success(){
alert('Test');
}
Attentive to any suggestions.