Alert box when no internet connection - Phonegap
问题 I'm trying to get a pop-up to, well, pop up when there is no internet connection on the device. I got the following example working, but now I want the alert only to show when the result is "No network connection". I tried this: if (states[Connection.NONE]){ alert('Geen internet :('); }; But that just makes the alert-box pop up, no matter if there is a connection or not. Who can help me? :) 回答1: Old-ish question, but here's how I'd do it - You can use events to detect if the device is online