I'm trying to create a button that once clicked, an overlay window would open up, containing HTML from an external file.
I've tried to combine this code with the code here but something is wrong I guess:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Dialog - Animation</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$( ".selector" ).dialog({
open: function(event, ui) {
$('#divInDialog').load('popup.html', function() {
alert('Load was performed.');
});
}
});
$( "#opener" ).click(function() {
$( "#selector" ).dialog( "open" );
});
</script>
</head>
<body>
<div class="selector"/>
<div id="divInDialog"></div></div>
<button id="opener">Open Dialog</button>
</body>
</html>