【发布时间】:2012-07-07 09:58:15
【问题描述】:
我正在为 jquery 使用数据表插件,并且正在使用 fnServerParams 函数。我已经发送了一些额外的变量,但我不确定如何在 server_processing 文件中检索它们。
代码:
$('#fleetsTable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/server_processing.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "customerId", "value": "6" } );
}
} );
这是我在 server_processing.php 文件中尝试过的
$customerId = "";
if ( isset( $_GET['customerId'] ) )
{
$customerId = $_GET['customerId'] ;
}
这似乎不起作用..
谢谢你的帮助
【问题讨论】:
-
但是您将变量命名为“名称”。你收到的是
$_GET['name'] = "customerID";和$_GET['value'] = "6"; -
我会做一个 print_r($_GET);看看你真正得到了什么,如果有的话。
标签: php jquery datatables