javascript で internet 接続を確認する for offline apps
http://www.w3.org/TR/offline-webapps/
In addition to those APIs HTML 5 also defines an onLine attribute on the Navigator object so you can determine whether you are currently online:
var online = navigator.onLine;
ということでnavigator.onLineのtrue/falseで接続確認が出来ました。