jquery dialog popup

I have an html code called HTMLA with and HREF to HTMLB(<a href="HTMLB.html">See B</a>)

HTMLB contains a jquery dialog box as per the below)

My challenge is that when I press on the URL to show the dialog of HTMLB, HTMLA screen disappears and only dialog box of HTMLB is displayed.

How can I superimpose HTMLB on HTMLA? In other words, both HTMLA and HTMLB must be displayed (similar to opening HTMLB as a popup window)


HTMLA
<a href="HTMLB.html">See B</a>



HTMLB
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Dialog - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#dialog" ).dialog();
  });
  </script>
</head>
<body>
 
<div id="dialog" title="Basic dialog">
  <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
 
 
</body>
</html>
Errol FarroAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Here is a good start
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
	$( "#dialog" ).dialog({
      autoOpen: false,
      height: 300,
      width: 350,
      modal: true,
      buttons: {
        Cancel: function() {
          $('#dialog').dialog( "close" );
        }
      },
      close: function() {
      }
    });
	$('.open-dialog').click(function(e) {
		e.preventDefault();
		$( "#dialog" ).dialog("open");
	});
});
</script>
</head>
<body>
<div>
	Your HTMLA code goes here <a href="#" class="open-dialog">Open Dialog</a>
</div>
<div id="dialog" title="Basic dialog" style="display: none">
	<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

</body>
</html>

Open in new window

More examples here http://jqueryui.com/dialog/#default
Errol FarroAuthor Commented:
I really need HTMLA and HTMLB to be two separate files. They cannot be combined in one for technical reasons. Is this possible ?
Julian HansenCommented:
Then you have the following options

1. Put an <iframe> in the popup that loads the second page
2. Use an AJAX call to get the contents of the second page and load it into the popup
3. Use javascript window.open to create a new browser window to display the content.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.