2017-12-01 7 views
-1

私はjquery mobileを使ってphonegapアプリケーションを作っています。私は検索して、電話バックボタンを使用してアプリケーションから終了する構文を見つけました。jquery mobileを使用してphonegapアプリケーションを終了するための終了通知を変更する方法はありますか?

<script> 
 
document.addEventListener("deviceready", deviceready, false); 
 
    function deviceready() 
 
{ document.addEventListener("backbutton", onBackKeyDown, false); 
 

 
    function onBackKeyDown() 
 
    { 
 
    if(confirm("Do you want to Exit?")) 
 
    { 
 
     navigator.app.exitApp(); 
 
    } 
 
    } 
 
    } 
 
</script>

それが下の画像のように動作しますが、私は、通知を変更したいです。 confirmbutton nameを変更できますか?たとえば、「OK」を「A」に、「Cancel」を「B」に変更してください。

enter image description here

答えて

0

私はこの構文を見つけたし、それが動作しますが、通知のインタフェースを変更する方法?どのように私はそれを変更するCSSを使用できますか?

<script> 
 
document.addEventListener("deviceready", deviceready, false); 
 
    function deviceready() 
 
{ document.addEventListener("backbutton", onBackKeyDown, false); 
 

 
    function onBackKeyDown() 
 
    { 
 
\t navigator.notification.confirm(
 
      'Are you sure want to exit?', // message 
 
      onConfirm,    // callback to invoke with index of button pressed 
 
      'confirm',   // title 
 
      'No,Yes'   // buttonLabels 
 
     ); 
 
    function onConfirm(buttonindex) 
 
    { if(buttonindex==1) 
 
    { 
 
     navigator.app.exitApp(); 
 
    } 
 
\t else { 
 
\t \t window.close(); 
 
\t } 
 

 
    } 
 
    } 
 
} 
 
</script>

関連する問題