任意のPhoneGapプロジェクトでは、DevicEready事件を最初に聴く必要があります。イベントトリガーは、DOMがロードされ、PhoneGapapiがロードされたことを示しています。
その他のイベント:<!doctype html> <html> <gead> <meta charset = utf-8/> <title> resume emply </title> <script = text/javascript charset = utf-8 src = cordova.js> </スクリプト> <テキスト/javascript charset = utf-8> document.addeventlistener(devicerereidy、ondeviceready、false){//登録イベントdocument.addeventlistener(resume、onresume、false); 、document。 false);} //リカバリーイベント関数onresume(){alert(page pause);} //メニューボタン関数onmenubutton(){alert([メニュー]ボタン);} / / returnボタン機能onbackbutton(){alert(return button); /オフラインイベントを処理する(インターネット接続の切断)関数isofline(){alert(disconnection);} </script> </head> <body> </body> </html>
上記の電話ガップが一般的に使用されているイベントの概要(必須)は、編集者のすべてのコンテンツを皆に共有したいと考えています。