Good all the time of day. Tell me, please, what am I doing wrong:

document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { alert('Hello!'); document.addEventListener("menubutton", onMenuKeyDown, true); } function onMenuKeyDown() { alert('menu key down'); } 

When you click on the menu button, nothing happens. Similarly, trying to catch an event for the searchbutton, etc. An example was taken from here http://docs.phonegap.com/en/2.3.0/cordova_events_events.md.html#menubutton

  • You wrapped document.addEventListener ("deviceready", onDeviceReady, false); in onLoad and added onLoad to body onload, as in your example? - LinnTroll
  • LinnTroll, thanks a lot for the answer. I found a problem. The fact is that I was doing a very simple wrapper around the site, laid out under the mobile phone. Accordingly, the application redirects to the website page window.location = " site.ru/mobile "; and it serves as a problem. If I commented out this line, the application starts tracking down. I do not know how to solve this problem yet, because First of all, you need only a very simple wrapper with several features, like a notification and a phone menu. - eugenes

0