Featured Post

2009-09-05 Universal Studios and Islands of Adventure

Friday night, Trevor had a preseason Cross Country Race at Disney’s Wide World of Sports.  Rather than drive home late that night, we decided to stay the night in Orlando and make use of the free Universal passes that Jennifer and I had received earlier in the year. This was Brandon’s first visit...

Read More

Simple, Reusable jQuery AJAX Dialog

Posted by Joe King | Posted in Web Development | Posted on 17-08-2010

Tags: ,

0

While working on a project recently, I needed a simple way of reusing a jQuery ajax dialog. The problem with the default jQuery UI dialog is that when it is closed, it is destroyed, making it unusable again.  I wanted a way to basically pass any URL to it and have it load in the dialog.

There are lots of plugins to accomplish this, but here is a dead simple way. Just surround the dialog div with a containing div (id=dialogcontainer), and recreate the dialog div (id= dialog) on each call.  The URL is passed via the value attribute.










Reusable Ajax Dialog using jQuery

Reusable Ajax Dialog 1
Reusable Ajax Dialog 1
Reusable Ajax Dialog 1
Reusable Ajax Dialog 1