Here is a sample http://jsfiddle.net/mUpjw/15/
I had JQuery 1.2 in some old code and it was opening dialog this way.
$('#myDiv').dialog('open');
I upgraded to jquery 1.6.1 and it was working fine . But if I add a DOCTYPE than it doesnt work but if I do
$('#myDiv').dialog();
That works fine.
What can be reason for this ?
You need to setup your dialog box.
<div id="dialog_link">click here</div>
<div id="mydiv" style="display:none;">This is some document here.Will be shown as used 'open'</div>
<div id="mydiv2" style="display:none;">This is some document here</div>
$(document).ready( function(){
$('#mydiv').dialog({
autoOpen: false,
width: 600,
buttons: {
"Ok": function() {
$(this).dialog("close");
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
$('#dialog_link').click(function() {
$('#mydiv').dialog('open');
return false;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With