jQuery Dialog Won't Open Twice


I'm loading a jQuery dialog with content AJAX style, and my dialog opens fine the first time, but not the second time.  I can get it to open as many times as I want ONLY if I have my dialog div on the same page, but int this case, I have my one page with the dialog, but the content is pulled in via the "success" call from the ajax.

I have a tabular grid with rows of data.  In one of the columns there is a button, the user clicks this button and it calls the below function "showMyWindow()".

I'm calling dialog('open') as you can see on line 29, but it won't open the second time. Here is my code:

function showMyWindow(someValue) {
		var url = "view/ajaxcontent.php";
		var tag = $("<div></div>");

				url: url,
				cache: false,
				type: "POST",
				data: { customerId: someValue },
				success: function(data) {
						cache: false,
						title: 'Customer Information',
						autoOpen: false,
						closeOnEscape: true,
						width: 350,
						height: 250,
						zIndex: 5000,
						buttons: false,
						position: "center",
						close: function(event, ui) {
				} // close success
			}); // close ajax
		return false;

Open in new window

Who is Participating?
Luis PérezSoftware Architect in .NetCommented:
You must destroy it before showing again. Replace your

close: function(event, ui) {


close: function(event, ui) {

Hope that helps.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.