jQuery modalen Dialogfeld die Schaltfläche text

Basiert auf dem code unten, um zu zeigen, ein JQuery-dialog der button text zeigt sich als der buchstäbliche "b" im Gegensatz zu den Wert der variable b ist.

Ie: showWarningDialog('myBody', 'myTitle', 'go') zeigt ein Dialogfeld mit einer Schaltfläche mit der Aufschrift b statt go.

Wie kann man go zu erscheinen?

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");
            }
        }
    });
}
InformationsquelleAutor Marcus Leon | 2010-10-25
Schreibe einen Kommentar