You have to set autoOpen
to true
. Demo :http://jsfiddle.net/GCu2D/82/
$(document).ready(function () {
var dialog = $('selector').dialog({
autoOpen: true,
buttons: {
"Yes": function () {
alert('you chose yes');
},
"No": function () {
alert('you chose no');
},
"Cancel": function () {
dialog.dialog('close');
}
}
});
});