I am creating a modal JQuery UI Dialog box and storing the result in the $dialog variable. The buttons change depending on which operation is chosen, so I set the buttons using a function call like this:
$dialog.dialog( "option", "buttons", [
{
text: "Ok",
click: function() { close_project(); }
},
{
text: "Cancel",
click: function() { ($this).dialog("close"); }
}
]);
This displays two buttons with the text '0' and '1' in them instead of 'Ok' and 'Cancel'. Also, the click functions do not appear to be working.
I've gone over this a number of times and the syntax looks correct. What am I doing wrong?