Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. location.reload();
  2.  
  3. setInterval(function() {
  4. if (navigator.onLine) {
  5. location.reload();
  6. }
  7. }, 120000); /* 120000 ~> 2 minutes */
  8.  
  9. setInterval(function() {
  10. $.when(
  11. $.ajax({
  12. url : "/favicon.ico", /* or other resource */
  13. type : "HEAD"
  14. })
  15. )
  16. .done(function() {
  17. location.reload();
  18. });
  19. }, 120000); /* 120000 ~> 2 minutes */
  20.  
  21. if (navigator.onLine) {
  22. //Actions
  23. }
  24.  
  25. var clrInterval=null;
  26. clrInterval = setInterval(function(){
  27. $.ajax({
  28. url:'',data:'',
  29. success:function(data);{
  30. if(data=='no-success') {
  31. // your code if no-success
  32. } else {
  33. clearInterval(clrInterval);// clear interval if you get success
  34. }
  35. }
  36. });
  37. },5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement