1

如果 android 没有互联网连接,要关闭 ios app phonegap jquery mobile:

function onDeviceOffline()   {
    var internet_status = navigator.onLine;
    if (internet_status == false) { 
        navigator.notification.confirm('Do you Want to exit from App?', 
            function confirmcCallback(buttonIndex) {
                if(buttonIndex == 1)
                {
                    navigator.app.exitApp();               
                }
            }, 'Chere Weddings', 'OK,Cancel');
    }
}
document.addEventListener("deviceready", onDeviceOffline, false);

但它不适用于ios,如何使用ios?

4

0 回答 0