I\'m toying with jQuery UI, and I like how this demo works: http://jqueryui.com/demos/dialog/#modal-message
However, when a dialog comes up, the only way to close it is
This is the preferred method to use when dealing with newer versions of Jquery.
$(".ui-widget-overlay").on("click", function(){ $(".ui-dialog-titlebar-close").trigger('click'); });