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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:22:40+00:00 2026-06-12T10:22:40+00:00

Following Code given: http://jsfiddle.net/UsZG8/1/ <html> <head> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js></script> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js></script> <link rel=stylesheet

  • 0

Following Code given:
http://jsfiddle.net/UsZG8/1/

<html>
    <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css"/>
    <script type="text/javascript">
      $(document).ready(function() {

            $("#modalDiv").dialog({
                modal: false,
                autoOpen: false,
                height: '500',
                width: '750',
                draggable: true,
                resizable: false,
                position: 'center',
                closeOnEscape: true,
            });
            $('#1stPage').click(
                function() {
                    url = 'mypage.html';
                    $("#modalDiv").dialog('option', 'title', 'Test 1st');
                    $("#modalDiv").dialog("open");
                    $("#modalIFrame").attr('src',url);
                    return false;
            });   

            $('#2ndPage').click(
                function() {
                    url = 'myPage2.html';
                    $("#modalDiv").dialog('option', 'title', 'Test 2nd');
                    $("#modalDiv").dialog("open");
                    $("#modalIFrame").attr('src',url);
                    return false;
            });  
      });
    </script>
    </head>
    <body>
        <a id="1stPage" href="#">1st link</a><br><br>
        <a id="2ndPage" href="#">2nd link</a>
        <div id="modalDiv"><iframe id="modalIFrame" width="100%" height="100%" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="auto" title="Dialog Title"></iframe></div>
    </body>
</html>

When just clicking one of the links, closeOnEscape is working fine.
When clicking on both links before hitting esc, closeOnEscape will not work.

It seems I missed something, also I couldn’t figure out where the problem is.
appreciate any help :).

  • 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-12T10:22:42+00:00Added an answer on June 12, 2026 at 10:22 am

    You have to “refocus” the dialog by clicking on it. When you click the second link it loses focus

    sending a close command before opening will refocus it

    $(document).ready(function() {
    
            $("#modalDiv").dialog({
                modal: false,
                autoOpen: false,
                height: '500',
                width: '750',
                draggable: true,
                resizable: false,
                position: 'center',
                closeOnEscape: true, 
            });
            $('#1stPage').click(
                function() {
                    url = 'mypage.html';
                    $("#modalDiv").dialog('option', 'title', 'Test 1st');
                    $("#modalDiv").dialog("close");//<----
                    $("#modalDiv").dialog("open");
                    $("#modalIFrame").attr('src',url);
                    $("#modalDiv").click();
                    return false;
            });   
    
            $('#2ndPage').click(
                function() {
                    url = 'myPage2.html';
                    $("#modalDiv").dialog('option', 'title', 'Test 2nd');
                    $("#modalDiv").dialog("close");//<----
                    $("#modalDiv").dialog("open");
                    $("#modalIFrame").attr('src',url);
                    return false;
            });  
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Appreciate some insight given the following code: <script type=text/javascript> $(document).ready(function() { var soapEnv =
Given the following code $c= new SoapClient('http://www.webservicex.net/CurrencyConvertor.asmx?WSDL'); $usa = USD; $eng = GBP; doing
I have downloaded the Android source code by following the steps given here http://source.android.com/source/downloading.html
given the following code <!DOCTYPE html> <html> <head> <title>show stats</title> <style> span.main { position:relative;
Given the following code var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type':
I have created the following code http://jsfiddle.net/N65yS/41/ .. My problem is this.. When I
Given the following code: var a = 'somegarbage=http://somesite.com/foo/bar/&moregarbage'; var result = a.match(/http.+\//g); Produces the
Looking at the following example of an embedded Jetty Example: http://musingsofaprogrammingaddict.blogspot.com.au/2009/12/running-jsf-2-on-embedded-jetty.html The following code
Per http://perldoc.perl.org/CGI.html to make meta tags, the following example is given: print start_html(-head=>meta({-http_equiv =>
Given the following code: <Window x:Class=WpfApplication76.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:col=clr-namespace:System.Collections;assembly=mscorlib Title=Window1 Height=300 Width=300> <Window.Resources> <CollectionViewSource

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.