Alert box when no internet connection - Phonegap

后端 未结 9 2653
南方客
南方客 2021-02-20 06:55

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 sh

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 07:38

    Add else to do nothing...

    if (navigator.network.connection.type == Connection.NONE) {
        alert('Geen internet :(');
    }
    else {
        // nothing
    };
    

提交回复
热议问题