how to use viriable text for dialog buttion of jquery ui


Referring to http://jqueryui.com/demos/dialog/ you can see there are 2 alternate ways of defining the buttons, one is what you are using here, the second is using arrays.
var button1 = 'Ok';
var button2 = 'Not Ok';    
$( ".selector" ).dialog({ buttons: [
    {
        text: button1,
        click: function() { $(this).dialog("close"); }
    },
    {
        text: button2,
        click: function() { $(this).dialog('close'); }
    }
] });

评论

热门博文