Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将字符串传递给jquery对话框以成为按钮的名称_Javascript_Jquery_Asp.net_Asp.net Mvc - Fatal编程技术网

Javascript 将字符串传递给jquery对话框以成为按钮的名称

Javascript 将字符串传递给jquery对话框以成为按钮的名称,javascript,jquery,asp.net,asp.net-mvc,Javascript,Jquery,Asp.net,Asp.net Mvc,为了实现全球化,我需要转换jquery对话框中的按钮,但当我试图传递变量时,我并没有得到变量的值,只得到它的名称 var RemoveDialogButton = "@FriendsNamesNS.FriendsNames.Remove"; var CancelDialogButton = "@FriendsNamesNS.FriendsNames.Cancel"; //alert(RemoveDialogButton); $( "#dialog-confirm"

为了实现全球化,我需要转换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
}
 var buttons= {};
 buttons[your text] = function() { ....};


 $('.selector').dialog({      
   buttons: my_buttons 
  });