Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- location.reload();
- setInterval(function() {
- if (navigator.onLine) {
- location.reload();
- }
- }, 120000); /* 120000 ~> 2 minutes */
- setInterval(function() {
- $.when(
- $.ajax({
- url : "/favicon.ico", /* or other resource */
- type : "HEAD"
- })
- )
- .done(function() {
- location.reload();
- });
- }, 120000); /* 120000 ~> 2 minutes */
- if (navigator.onLine) {
- //Actions
- }
- var clrInterval=null;
- clrInterval = setInterval(function(){
- $.ajax({
- url:'',data:'',
- success:function(data);{
- if(data=='no-success') {
- // your code if no-success
- } else {
- clearInterval(clrInterval);// clear interval if you get success
- }
- }
- });
- },5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement