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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:32:12+00:00 2026-05-27T20:32:12+00:00

I have the following in jQuery mobile: <script type=text/javascript> $(#locate_results).live(pageinit, function(event) { $(#venues li

  • 0

I have the following in jQuery mobile:

<script type="text/javascript">
    $("#locate_results").live("pageinit", function(event) {
        $("#venues li a").click(function(e) {
            e.preventDefault();
            // Update location
            $(".ui-dialog").each(function() { $(this).dialog("close"); });
        });
    });
</script>

<div data-role="page">
    <div data-role="header">My Form</div>
    <div data-role="content">
        ... other content ...
        <a href="#locator" data-rel="dialog">Choose a Location</a>
    </div>
</div>
<div data-role="dialog" id="locator">
    <div data-role="header">Search for a Location</div>
    <div data-role="content">
        <form action="/locate" method="post" data-rel="dialog">
            <input type="text" name="query" />
            <input type="submit" value="Search" />
        </form>
    </div>
</div>

The output of /locate is as follows:

<div id="locate_results" data-role="dialog">
    <div data-role="header">Search Results</div>
    <div data-role="content">
        <ul id="venues" data-role="listview">
            <li><a href="#">Venue 1 Name</a></li>
            ... more results ...
        </ul>
    </div>
</div>

So essentially,

  1. User clicks the “Add a Location” link.
  2. Location search form is loaded in a dialog
  3. Search results loaded in a second dialog
  4. User clicks a search result in the second dialog.

Step 5 should be both dialogs closing, returning the user to the original page content. However only the topmost dialog (#locate_results) closes. I have also tried the following and gotten the same result:

$("#locate_results").dialog("close");
$("#locator").dialog("close");

and

$(".ui-dialog").dialog("close");

I’ve tried following these answers, with no luck:

  • close multiple jquery ui dialogs at once

What would be the correct way to close all open dialogs in jQuery Mobile?

jsFiddle demonstrating the issue:

http://jsfiddle.net/zUuSy/

  • 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-27T20:32:13+00:00Added an answer on May 27, 2026 at 8:32 pm

    It appears to be a bug.

    Here’s a snip from jQuery Mobile’s close method:

    // Close method goes back in history
    close: function() {
        window.history.back();
    }
    

    What’s happening is certain browsers run into issues with calling window.history.back() multiple times in succession, so calling $(".ui-dialog").dialog("close") only goes back in history once. However, calling window.history.go(-2) appears to work.

    Take a look: http://jsfiddle.net/rummik/zUuSy/4/

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

Sidebar

Related Questions

I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have following jQuery/JS code <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js></script> <script> $.getJSON(http://example/topics, {}, function(data){ console.log( data
I am referencing JavaScript as follows on an HTML page: <script type=text/javascript src=http://code.jquery.com/jquery-1.6.1.min.js></script> <script
I have the following JQuery function being attached to the blur event of n
I have the following jQuery Code: $(#menu span).click(function() { var url = this.getAttribute(data-url); var
I have the following jQuery: $(document).ready(function () { $(.element).draggable(); $(.element).droppable({ drop: function () {
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following jquery function for filtering the contents of a listbox on
i have implemented facebook log in using Facebook javascript SDK in Jquery mobile ,
I have the following jquery mobile code: <div data-role=collapsible> <h3>I like to read a

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.