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 9133147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:26:14+00:00 2026-06-17T08:26:14+00:00

Using jquery mobile 1.2, I have a popup menu (OK/Cancel) which should be answered

  • 0

Using jquery mobile 1.2, I have a popup menu (OK/Cancel) which should be answered before changing to a new page. But the page changes (and the popup disappears) before it is clicked:

if (rider.time.valueOf() > 0) {
    $('#popupMsg').text("Rider has already finished; update the time?");
    $('#alreadyFinished').popup("open");
}
alert("rf");
// other code.......
$.mobile.changePage("#finishLine");
// other code.......

I put in the ‘alert’ just to prove that the popup does actually appear – there it is, behind the alert, but the popup closes (and the page changes) as soon as the alert is clicked. Also tried removing the ‘other code’ but still the same problem.

Here’s the html:

    <div data-role="popup" id="alreadyFinished" class="ui-content">
         <p id="popupMsg"></p>
         <a data-role="button" data-theme="b" id="OKBtn">OK</a>
         <a href="#finishLine" data-role="button" data-theme="c"  id="cancelBtn">Cancel</a>
     </div>

Even without the buttons in the popup, the popup doesn’t persist. So what’s wrong?

  • 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-06-17T08:26:14+00:00Added an answer on June 17, 2026 at 8:26 am

    A jQuery Mobile popup is part of a page. Changing the page will close any current popup, so you should not directly call it following the opening of a popup. The following code would open your popup and not close it.

    if (rider.time.valueOf() > 0) {
        $('#popupMsg').text("Rider has already finished; update the time?");
        $('#alreadyFinished').popup("open");
    } else {
        alert("rf");
        // other code.......
        $.mobile.changePage("#finishLine");
    // other code.......
    }
    

    If you want your popup to be modal, the simplest way is to bind the execution of the rest of your code to the closing of the popup. For instance, if you want the restOfCode function to be run after the popup is closed:

    $('#alreadyFinished').popup("open");
    $( "#alreadyFinished" ).on({
       popupafterclose: function(event, ui) {restOfCode()}
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display a Popup using jQuery Mobile, but I have a problem
Note: I'm using jQuery and jQuery Mobile. I have a mobile page which seems
I have a PhoneGap App using jQuery Mobile. At a certain page, I cannot
I am developing an events page using jquery mobile. I have a stylish way
I have a Phonegap App, using jQuery and jQuery Mobile. In some page I've
I have a form that spans multiple pages in jQuery Mobile. I'm using multi-page
I am using jquery mobile... I have a button (data-role=button) which calls a javascript
I want to build a mobile app using jQuery Mobile. The App should have
I'm using Jquery Mobile for an application, which has a login popup on every
I am using jQuery Mobile and have few pages in one HTML page. When

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.