I am trying to force a dialog to close after it was initialized. This is how the dialog is initially created
$("#myDialog").dialog({
width: 960,
hide: 'slide',
position: 'top',
show: 'slide'
});
The reason why I’m not attaching the event to the above code is that I do not want the dialog to always redirect on close. I only want the redirecting to happen manually. I am trying to use this code after the dialog is displayed but it does not work.
$("#myDialog").dialog({
close: function(event, ui) { location.href = 'whatever.html' }
});
You can use the
optionmethod to change options on an existing jQuery UI widget:Demo: http://jsfiddle.net/ambiguous/nuGqK/
This should work for any dialog option.