»
EnglishFrenchVietnamese

Print - Online/Offline Page Checker script - JavaScriptBank.com

Full version: jsB@nk » Utility » Online/Offline Page Checker script
URL: https://www.javascriptbank.com/online-offline-page-checker-script.html

Online/Offline Page Checker script © JavaScriptBank.comA simple JavaScript to check online/offline status of page, by check some domain name.

Full version: jsB@nk » Utility » Online/Offline Page Checker script
URL: https://www.javascriptbank.com/online-offline-page-checker-script.html



JavaScript
<script type="text/javascript">// Created by: Mr J | http://www.huntingground.net/function chk_url() {  url=unescape(document.location)  // enter the URL below you want to check  if(url.indexOf("javascript.internet.com")!= -1){ // if this string is found    alert("You are online") // do this if online  } else {    alert("You are offline") // do this if offline  }}// Multiple onload function created by: Simon Willison// http://simon.incutio.com/archive/2004/05/26/addLoadEventfunction addLoadEvent(func) {  var oldonload = window.onload;  if (typeof window.onload != 'function') {    window.onload = func;  } else {    window.onload = function() {      if (oldonload) {        oldonload();      }      func();    }  }}addLoadEvent(function() {  chk_url();});</script>