In the following code, I am using string literals:
$("#divDialogSave").dialog(
{
resizable: false,
height: "auto",
modal: true,
autoOpen: false,
buttons:
{
"Yes": function ()
{
},
"No": function ()
{
}
}
});
I wanted to replace the text "Yes" and "No" with constants, so I did this:
var TEXT_YES = "Yes";
var TEXT_NO = "No";
$("#divDialogSave").dialog(
{
resizable: false,
height: "auto",
modal: true,
autoOpen: false,
buttons:
{
TEXT_YES: function ()
{
},
TEXT_NO: function ()
{
}
}
});
But the text displayed ends up being the name of the variable instead of the actual text held by the variable. What am I doing wrong?