Custom JavaScript alerts in iOS using PhoneGap HTML

后端 未结 3 456
渐次进展
渐次进展 2020-12-31 10:29

My app has a couple of JS alerts and it seems to always display the page name like.

index.html

Is there a way to change the index.html to my App\'s name or

3条回答
  •  北海茫月
    2020-12-31 11:28

    To be able to test on both a desktop browser and PhoneGap application, I suggest to use a dynamic approach as such:

    function showMessage(message, callback, title, buttonName) {
    
        title = title || "default title";
        buttonName = buttonName || 'OK';
    
        if(navigator.notification && navigator.notification.alert) {
    
            navigator.notification.alert(
                message,    // message
                callback,   // callback
                title,      // title
                buttonName  // buttonName
            );
    
        } else {
    
            alert(message);
            callback();
        }
    
    }
    

提交回复
热议问题