window.navigator.onLine might not be working in phonegap, testing this