Close modal dialog box when clicked outside

I was searching for a way to close my modal dialog box when clicked outside of the dialog and i found a very good article by Ryan Jeffords at: http://www.ryanjeffords.com/blog/entry/closing-a-jquery-ui-dialog-when-the-dialog-loses-focus Thanx Ryan <script type=”text/javascript”> //Wait for the document to load $(document).ready(function() { //Create the dialog and open it $(“#dialog”).dialog(); //Bind to the ui-widget-overlay and watch for when it is clicked …

adminClose modal dialog box when clicked outside

Check whether the div exists [Jquery]

This is how you can check whether the div exists: if ( $(“#message”).length ) { $(‘#message’).text(“Hello!”); }

adminCheck whether the div exists [Jquery]