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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:29:03+00:00 2026-06-17T15:29:03+00:00

I am using jQuery Mobile for developing a simple workflow. I am switching from

  • 0

I am using jQuery Mobile for developing a simple workflow.

I am switching from Page0 (or Page1) to Page2. I would like to have Page2 to display Page3 (based on a condition) as a dialog before even showing itself. If I click on “cancel” in the dialog (Page3), I would like to return to Page0 (or Page1).

I am able to show the dialog, but it shows after Page2 is shown (like a flicker). Cancel (with data-rel:back) always goes back to Page2 and finally ending up in infinite-loop.

Can anyone help me with this?

I tried my best to explain this. Let me know if this is not completely clear.

  • 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-17T15:29:04+00:00Added an answer on June 17, 2026 at 3:29 pm

    Something like this: http://jsfiddle.net/Gajotres/7RQaM/

    <!DOCTYPE html>
    <html>
    <head>
        <title>jQM Complex Demo</title>
        <meta name="viewport" content="width=device-width"/>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
        <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>    
    </head>
    <body>
        <div data-role="page" id="page0">
            <div data-theme="a" data-role="header">
                <h3>
                    Page 0
                </h3>
                <a href="#second" class="ui-btn-right">Next</a>
            </div>
    
            <div data-role="content">
                <a href="#page3" data-role="button" data-rel="dialog">Open dialog</a> 
            </div>
    
            <div data-theme="a" data-role="footer" data-position="fixed">
    
            </div>
        </div>
    
        <div data-role="dialog" id="page3">
    
            <div data-role="header" data-theme="d">
                <h1>Dialog</h1>
    
            </div>
    
            <div data-role="content" data-theme="c">
                <h1>What do you want to do?</h1>
                <p>This is a regular page, styled as a dialog. To create a dialog, just link to a normal page and include a transition and <code>data-rel="dialog"</code> attribute.</p>
                <a href="#page2" data-role="button" data-theme="b">Go to page 2</a>       
                <a href="#page0" data-role="button" data-theme="c">Go back to page 0</a>    
            </div>
        </div>    
    
        <div data-role="page" id="page2">
            <div data-theme="a" data-role="header">
                <a href="#page0" class="ui-btn-left">Back</a>            
                <h3>
                    Page 2
                </h3>
            </div>
    
            <div data-role="content">
    
            </div>
    
            <div data-theme="a" data-role="footer" data-position="fixed">
    
            </div>
        </div>
    </body>
    </html>   
    

    You can’t show 2 pages at the same time. So the best thing is to show dialog and let user choose what to do.

    This is the main problem. You can order page change to page2 and then use some page event (like pagebeforeshow) to instantly switch to page2. Because of how jQM works page2 will show for the brief moment. But even if you can fix this. When you close dialog and it goes back to page2 it will again show a dialog box because its pagebefpreshow is still trying to changePage to dialog box.

    EDIT :

    I was wrong, it can be done like this:

    $('#page3').live('pagebeforeshow',function(e,data){    
        $('[title="Close"]').off();
        $('[title="Close"]').attr('href','#page2');
    });
    

    Basically what you want to do is to show dialog without showing page2. And override its closing button to changePage where you want. $(‘[title=”Close”]’).off(); is here to remove prior event.

    I have also change an example from the top.

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

Sidebar

Related Questions

I am currently developing a mobile site using jQuery mobile. I have one simple
I am developing a site for mob using jquery mobile. I have a content
I am developing an events page using jquery mobile. I have a stylish way
I am developing a mobile application using phonegap and jquery mobile. I have this
I'm developing a mobile app using PhoneGap and jQuery Mobile. From what I've read
I am developing mobile browser app using html5 and jquery mobile. I have a
I am developing the application using jQuery Mobile 4.1. In my app, I have
I'm developing a mobile website using the jQuery Mobile library. I have a header,
I have made a set of HTML5 pages using Jquery mobile. While developing I
I'm developing a mobile site for iPhone using jQuery. I have a hidden div

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.