Snippet for popping up a jQuery UI Dialog

The jQuery UI Dialog plugin is a nice way of popping up a message on a page without using the Javascript alert() function.

The are lots of different ways and options you can use to actually display the dialog and control it's behavior. But the most basic method that I generally use (adapted from here) looks like this:

~~~~ {.javascript name="code"} function dlg(msg, title) { var $dialog = $('').html(msg).dialog({ title: title});} wzxhzdk:0