Dialog with options doesn't work
I'm trying to grasp how to use a dialog and have tried several examples. This first example works fine and the dialog opens as it should.
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
- <script>$( "#dialog" ).dialog({ autoOpen: false });
$( "#opener" ).click(function() {
$( "#dialog" ).dialog(
"open"
);
});
</script>
- <button id="opener">open the dialog</button><div id="dialog" title="Dialog Title">I'm a dialog</div>
If I add the following, the second dialog doesn't open.
- <script>$( "#dialog4" ).dialog({ autoOpen: false });
$( "#opener4" ).click(function() {
$( "#dialog4" ).dialog(
autoOpen: false,
height: 300,
width: 450,
resizable: false,
buttons: {
"Ok": function(){
$(this).dialog('close');
}
}
)
});
- <button id="opener4">open the dialog</button><div id="dialog4" title="Dialog Title">I'm a dialog</div>
I'm sure I am making some basic mistake but I've gone over it many times, as well as the documentation, and I can't see the problem. Would someone please point out my mistake?