背景: sencha 2.1 を使用して SenchaTouch アプリケーションを開発しました。現在、コルドバ 2.2.0 js を使用して簡単なアラート メッセージを表示しようとしています。
私の基本的な疑問は、「Google Chrome で 'navigator.notification.alert' を使用してアラート ボックスを表示できますか、それともエミュレータで実行してアラート ボックスを表示する必要がありますか?」ということです。
以下の手順に従いました。
私のワークスペースにcordova 2.2.0 jsを含め、index.htmlから参照しました。Google Chrome の [ネットワーク] タブに読み込まれたファイルを確認できます。
以下は、ボタンのクリックでネイティブ アラート ボックスを表示するコードです。
alertDismissed : function() { console.log('This function is called'); } onLoginNoteCommand: function () { console.log('onLoginNoteCommand'); navigator.notification.alert( 'Please Select a Car', // message this.alertDismissed, // callback ' ' // title ); }
エラーが発生しました
" Uncaught TypeError: Cannot call method 'alert' of undefined
" エラーが発生しています。
私が間違っているところはありますか?
ありがとう