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

  • SEARCH
  • Home
  • 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 7685287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:13:04+00:00 2026-05-31T19:13:04+00:00

I am playing with my first PhoneGap/Android app, and am having trouble triggering $.mobile.changePage()

  • 0

I am playing with my first PhoneGap/Android app, and am having trouble triggering $.mobile.changePage() from a PhoneGap/Cordova Event.

I’ve updated the code, whereas before it would trigger once. Now it does not trigger at all, but is closer to how it probably should be done.

Here is my code:

    $(document).on('pageinit', function() {
        document.addEventListener("searchbutton", onSearchKeyDown, false); //never fires
        document.addEventListener("menubutton", onMenuKeyDown, false); //never fires
        alert("triggered"); //does fire
    });

    // search button press
    function onSearchKeyDown() {
        //change to search page
        alert("search");
        $.mobile.changePage("#page4", {transition: "pop"});
    }

    //menu button press
    function onMenuKeyDown() {
        //change to start page
        alert("menu");
        $.mobile.changePage("#page1", {transition: "pop"});
    }
  • 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-31T19:13:05+00:00Added an answer on May 31, 2026 at 7:13 pm

    Here is the solution if anyone else has this problem.
    via https://stackoverflow.com/a/9739986/799876

    A few lines up from the bottom of cordova.js, there is the line

    channel.onNativeReady.subscribe(_self.boot);
    

    Change it to

    channel.onNativeReady.subscribeOnce(_self.boot);
    

    For me, this fixed the menubutton and searchbutton events with phonegap & jQuery Mobile.

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

Sidebar

Related Questions

I am playing around with EF Code First and now ran into trouble when
Just playing around with memcache for the first time; here's my code: $memcache =
I am having the following problem when playing sounds on the blackberry: The first
I'm playing with PhoneGap for the first time. I'd like to do the following:
I'm playing around with EF Code First and need some help. A User can
Hi now playing with SQL for the first time! I have the code below
I have been playing around quite a lot with EF4 Code First and I
I'm playing with a Node.JS app for the first time, and so far I
First time playing with Log4Net and I'm running into trouble. I've followed various tutorials
I'm playing around with C++ for the first time in years. Making an app

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.