2014-11-02 4 views
3

나는 인터넷 연결 및 푸시 알림과 같은 대화 경고 메시지를 구현 한 phonegap 응용 프로그램에서 작업하고 있습니다. 모든 유형의 대화 상자에서 메시지 상단의 index.html을 얻습니다. 어떻게 제거 할 수 있습니까?Phonegap 경고 대화 상자에 메시지 상단에 index.html이 표시됩니다.

 <script type="text/javascript" charset="utf-8"> 
    //Check Internaet Connection 
    function onOnline() {    
       ("") 
    } 
    document.addEventListener("offline", onOffline, false); 
    function onOffline() { 
     alert("No estas conectado al internet") 
    } 
     document.addEventListener("online", onOnline, false); 
     </script> 

enter image description here

답변

7

를 사용하여 대화 상자 대신 플러그인 :
https://www.npmjs.com/package/cordova-plugin-dialogs

cordova plugin add cordova-plugin-dialogs 

그런 다음 당신이 alert() 모든 통화를 대체 할 수

navigator.notification.alert(message, alertCallback, [title], [buttonName]) 

E xample :

navigator.notification.alert(
    'You are the winner!', // message 
    alertDismissed,   // callback 
    'Game Over',   // title 
    'Done'     // buttonName 
); 

그냥 표준 alert() 블록 스크립트 실행, 플러그인 버전은 따라서 비 블로킹이며, 반면 선택적 콜백을 제공하는 유의하십시오.

+0

나는 그것을했고 나는 여전히 같은 결과를 얻고있다. – Rijo

+0

그러나 navigator.notification.alert를 사용하도록 변경 했습니까? –

+0

이 플러그인 이름 = "알림"값 = "CDVNotification"/>을 의미합니까? – Rijo

관련 문제