I am trying to close the warning as soon as an event occurs. I am currently getting a popup when the internet is disconnected (I want this). But as soon as the connection is restored, I want the pop-up window to disappear automatically - no need to delete the output or OK.
I have this code:
setInterval(function(){
if(navigator.onLine){
( ".selector" ).popup( "close" );
}else{
window.alert("It seems you have lost connection to the internet.
Please reconnect before continuing.");
}},2000);
thank
source
share