I\'m trying to perform a specific action when I close a jQuery UI dialog. Here\'s a simplified version of my code:
$(\'a.open-trigger\').click(function(){
You've bound a function to the open button that adds a event handler to the close button each time the open event is fired. You should add your close event handler somewhere outside of 'a.open-trigger' event function...
$('a.open-trigger').click(function(){
var test = 'hello';
$('#dialog').dialog({bgiframe: true, dialogClass: 'change', resizable: false, draggable: false, modal: true, height: 334, width: 450, autoOpen: false, show: 'fade'});
$('#dialog').dialog('open');
});
$('a.close-trigger').click(function(){
alert(test);
$('#dialog').dialog('close');
});