为了全球化,我需要翻译jquery对话框中的按钮,但是当我尝试传递变量时,我没有得到变量的值,只是变量的名称。

    var RemoveDialogButton = "@FriendsNamesNS.FriendsNames.Remove";
    var CancelDialogButton = "@FriendsNamesNS.FriendsNames.Cancel";

   //alert(RemoveDialogButton);

   $( "#dialog-confirm" ).dialog({
        autoOpen: false,
        resizable: false,
        height:190,
        modal: true,
        buttons: {
        RemoveDialogButton: function() {
             $( this ).dialog( "close" );
            $('#yesno').click();
            return true;
        },
        CancelDialogButton: function() {
        $( this ).dialog( "close" );
        }
      }
    });

最佳答案

RemoveDialogButton: {
      click: function() {
          $( this ).dialog( "close" );
          $('#yesno').click();
          return true;
      },
      text: RemoveDialogButton
}

08-15 16:41