Blog

jQuery UI $.dialog – on the fly HTML

by Ashish Datta

Wow its been awhile!

We’ve been insanely busy over the last month or so. We launched Setfive Ventures and are anxiously anticipating the launch of both WeGov and OmniStrat in the immediate future. There are also a handful of internal project that should be rolling out before Christmas. Get Excited.

Anyway, the jQuery UI Dialog class is pretty sweet. Basically, it provides a class to display a modal dialog box from a regular old DOM element (a div, span, or whatever.)

One of the thing that isn’t explained well (or at all?) in the documentation is that you can create a dialog with on the fly HTML! I found this out after posting on the Google Group asking why this feature didn’t exist (it does. Ashish fail.)

So if you want to create a dialog with on the fly HTML all you need to do is:

$("<p>Hello World!</p>").dialog();

Pretty sweet.

Tags: ,

2 Responses to “jQuery UI $.dialog – on the fly HTML”

  1. yalamber Says:

    I really needed this one for one of my project. thank you so much have been searching around and finally got this post. jquery ui rocks

  2. yalamber Says:

    One thing though how do we set title of the dialog this way?

Leave a Reply