I'm trying to trigger an alert close once an event happens. Currently I get a popup when the internet cuts out (I want that). But once the connection is reestablished, I want the popup to automatically go away - not having to hit exit 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);
Thanks