A simple method of checking offline status with jQuery for web apps or hybrid app (Node-Webkit or Phonegap)