Based on the code below to show a JQuery dialog, the button text shows up as the literal "b" as opposed to the value of the variable b.
Ie: showWarningDialog('myBody', 'myTitle', 'go')
shows a dialog with a button labelled b
instead of go
.
How can you get go
to appear?
function showWarningDialog(theBody, theTitle, buttonText) {
var t = "Warning";
if (theTitle != null) {
t = theTitle;
}
var b = "Ok";
if (buttonText != null) {
b = buttonText;
}
$("#div-dialog-warning div").text(theBody);
$("#div-dialog-warning").dialog({
title: t,
resizable: false,
height: 160,
modal: true,
buttons: {
b : function () {
$(this).dialog("close");
}
}
});
}