In any PhoneGap project, the DeviceReady incident should be listened first. Event trigger indicates that the DOM has been loaded and PhoneGapapi has been loaded. At this time, other events can be detected or processed other contents.
Other events:<! Doctype html> <html> <gead> <meta charset = UTF-8/> <Title> PHONEGAP ResuMe Example </Title> <Script Type = Text/Javascript Charset = UTF-8 SRC = cordova.js> </ Script> <Script Type = Text/Javascript Charset = UTF-8> Document.adDeventListener (DeviceRereidy, onDeviceReady, False); {// Register event listener Document.addeventListener (Resume, Onresume, False); Document .adDeventListener (PAUSE, Onpause, FALSE); Document.adDeventListener (Menubutton, onmenubutton, False); TTON, FALSE); Document.adDeventListener (SearchButton, onsearchButton, FALSE); Document.adDeventListener (Online, Isonline , FALSE); Document.addeventListener (Office, isofline, FALSE);} // Treatment the recovery event function onResume () {alert (page recovery); {alert (page pause);} // Process the menu button function onMenubutton () {alert (click the menu button);} // process the return button function onBackButton () {alert (click the return button); alert (click search Button);} // Treatment of online events (connected to Internet) function isonline () {alert (network connection);} // handle offline events (disconnecting the Internet connection) function isofline () {alert (disconnection);} </script> </head> <body> </body> </html>
The above -mentioned PhoneGAP commonly used event summary (must -see) is all the contents of the editor shared with everyone. I hope to give you a reference, and I hope that everyone will support VEVB Wulin.com.