1

为了全球化的目的,我需要在 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" );
        }
      }
    });
4

2 回答 2

1
RemoveDialogButton: {
      click: function() {
          $( this ).dialog( "close" );
          $('#yesno').click();
          return true;
      },
      text: RemoveDialogButton
}
于 2013-02-28T13:29:13.423 回答
0
 var buttons= {};
 buttons[your text] = function() { ....};


 $('.selector').dialog({      
   buttons: my_buttons 
  });
于 2013-02-28T13:34:34.140 回答