I am playing around with jQuery UI. I wanted to dynamically display dialog box, when the user clicks the body element. While the dialog displays, I cannot close it. Moreover, if the dialog displays at page load, closing is possible.
$("body").click(function(e){
$("#dialog").dialog({
title:"Title here",
buttons:{
Update:function(){$(this).dialog("close");},
Cancel:function(){$(this).dialog("close");}
}
});
});
Any idea what am I missing?
$(this)refers back to your$("body")