your on the right track. what you do is put your error div your html like this
<div title="ERROR" id="error"></div>' then setup your dialog $(document).ready(function(){ $("#error").dialog({ autoOpen: false, modal: true, buttons: { "Close": function() { $(this).dialog("close"); } }); }); then elsewhere in your javascript when you want to show the error you call $("#error").dialog('open'); hth Mike On Dec 2, 9:25 pm, matsubokkuri <matsubokk...@gmail.com> wrote: > Hi. > > First, I apology I'm not sure this question is only for jquery-ui or > Javascript matter. > > I'd like to use dialog() function in many pages. The code of > Javascript will be following. > ---------------------- > $('<div title="ERROR"></div>') > .text('Error message') > .dialog({ > modal: true, > buttons: { > "Close": function() { > $(this).dialog("close"); > } > } > }); > ---------------------- > > I want to override default parameter of the function to avoid writing > similar codes. > After overriding the parameter, I think I can call the function with > following code. > ---------------------- > $('<div title="ERROR"></div>') > .text('Error message') > .dialog(); > ---------------------- > > Best regards. -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery...@googlegroups.com. To unsubscribe from this group, send email to jquery-ui+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.