Simple, Reusable jQuery AJAX Dialog
Posted by Joe King | Posted in Web Development | Posted on 17-08-2010
Tags: ajax, jquery
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

