I'm using phonegap with jquery mobile and I want to check the internet connection regularly. From what I have read in other questions that are similar, I can't only use document.addEventListener("online", onOnline, false); because that is only fired when your app is already is loaded and regains a connection. This is not fired on start of the application. I also can't rely on navigator.network.connection.type; because that will apparently only tell me whether or not I'm connected to a router and not necessarily to the internet. Using an Ajax call to GET the google homepage as an alternate way to check connection doesn't work in phonegap for me because it returns a '404 not found error'
What are the other options? I'm not Terminal proficient so some of the documentation for exotic plugins are very hard for me to follow.