使用DataTables和Perl CGI的fnServerParams

时间:2013-10-05 22:00:41

标签: jquery perl cgi jquery-datatables

我在这里得到了这个CGI代码:

   \$('#example').dataTable( {
         "bProcessing": true,
         "bServerSide": true,
         "sAjaxSource": "scripts/run.cgi",
         "fnServerParams": function ( aoData ) {
            aoData.push( { "mysqltablename": "MYSQL_123490dfasdf039a" } );
         },
         "iDisplayLength": 50
     } );

我不知道如何在run.cgi端访问密钥:value(mysqltable,MYSQL_123490dfasdf039a)。我尝试了以下但没有看到它列出。帮助

new CGI
...
my %paramstemp = $q->Vars;
       open (FILE, ">/proj/hwmodels/unix_webserver/temp/asdf") ;
       print FILE Dumper \%paramstemp; 
       close FILE;

1 个答案:

答案 0 :(得分:0)

花了太多时间。发现语法正是这样的:

                 "fnServerParams": function ( aoData ) {
                    aoData.push( { "name": "mysqltablename", "value": "MYSQL_123490dfasdf039a" }, { "name": "asdfasdf", "value": "asdfasdfasdf" } );
                 }