views:

84

answers:

2

dialog() is already initiated at this point with:

$("#repshare_dialog").dialog({autoOpen: false});

Next I'm trying to open a dialog box with a title, is this right?

$("#repshare_dialog").dialog({ open: function(event,ui) { title: "foo" } });

A: 

Try this instead:

$("#repshare_dialog").dialog({ title: "foo" });

You only need to use the open event if you want to perform some action when the dialog has been opened.

Check out the jQuery UI docs for more options and detailed information.

Marve
A: 

If you're going to use autoOpen:false, what you want is:

$('#repshare_dialog').dialog({
  autoOpen: false,
  title: 'whatever'
});

later

$('#repshare_dialog').dialog('open');

If for some reason you really need to set the title after the dialog has been created, you can do it between the create and the open using

$('#repshare_dialog').dialog('option', 'title', 'Bananas in Pajamas');

as per the docs.

hobbs