How to set jQuery UI dialog defaults
问题 How do I set the default values for the jQuery UI dialog? For example, this is how I set the defaults in the jQuery UI datepicker: $.datepicker.setDefaults({ dateFormat: 'dd/mm/yy' }); I couldn't find the same functionality in the dialog documentation 回答1: I found a solution $.extend($.ui.dialog.prototype.options, { modal: true, width: 650 }); 回答2: There's no built-in functionality for that AFAIK, but what I usually do is set them myself in a separate hash like this: var dialog_defaults = {