Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:00:37+00:00 2026-05-26T17:00:37+00:00

I have the following code to test the menu button : <script type=text/javascript cahrset=utf-8>

  • 0

I have the following code to test the menu button :

<script type="text/javascript" cahrset="utf-8">     
    //wait till device is ready
document.addEventListener("deviceready", onDeviceReady(), false);

//add a menu button event handler
function onDeviceReady() {
    alert('deviceready');
    document.addEventListener("menubutton", onMenuKeyDown(), false);
}
    //fired when menubutton of device is clicked
function onMenuKeyDown() {
    alert('menu key down');
}

</script>

however when I press them menu button, nothing happens. Logcat says nothing, but I guess since this is from tag “web console” it might be useful:

10-13 15:46:16.720: INFO/Web Console(13969): Error in success callback: Network Status1 = TypeError: Cannot read property 'apply' of undefined at :-2167

I followed this Tutorial from Phonegap API Reference but it doesnt seem to handle my menu button presses.
any help? thanks a lot in advance, daniel

edit: Maybe this is helpful for you to know whats going on: When I press the menu Button, logcat shows

10-18 09:21:52.560: WARN/WindowManager(152): statePower =normal

also, the event “searchbutton” doesnt work either

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:00:38+00:00Added an answer on May 26, 2026 at 5:00 pm

    From what I can see, it looks like an issue with your listeners. By adding the brackets at the end of the function name, you are invoking the function immediately when the listener is setup, instead of setting a reference for the event to fire later.

    Try:

    document.addEventListener("deviceready", onDeviceReady, false);
    

    And:

    document.addEventListener("menubutton", onMenuKeyDown, false);
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code <html> <head> <title>Test</title> <style type=text/css> <!-- body,td,th { color:
I have the following code var test; $.ajax({ type: "GET", url: "../views/person/controller.php?actor=person&action=checkAge", data: "age="
I have following code public class TEST { public static void main(String arg[]){ try
I have the following test code use Data::Dumper; my $hash = { foo =>
I have the following test-code: CREATE TABLE #Foo (Foo int) INSERT INTO #Foo SELECT
I have the following code: public class Test { public static void Main() {
I have the following code: public class Test extends JFrame implements ActionListener{ private static
Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);
I have the following code: main = do putStr Test input : content <-
I have the following code snippet. $items['A'] = Test; $items['B'] = Test; $items['C'] =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.