[英]How to get server-side parameters using jQuery UI remote?
I have a php ajax script that is getting called by some jQuery, and I can not seem to get the parameters that are being passed. 我有一个被一些jQuery调用的php ajax脚本,我似乎无法获取正在传递的参数。 Here is the example I am working from: http://jqueryui.com/demos/autocomplete/#remote 这是我正在使用的示例: http : //jqueryui.com/demos/autocomplete/#remote
In my php side, I did something like this just to see what my parameters are: 在我的php端,我做了这样的事情,只是看我的参数是什么:
error_log ("1) ".var_dump($_GET));
error_log ("2) ".var_dump($_POST));
error_log ("3) ".var_dump($_REQUEST));
But they all return empty. 但是他们全都空了。 Can that be? 可以吗 How can I get at the parameters that are being passed? 如何获得正在传递的参数?
Thanks!! 谢谢!!
Here is my js: 这是我的js:
$(function()
{
$( "#birds" ).autocomplete({
source: "/problems/get_categories_ajax.php",
minLength: 2,
select: function( event, ui )
{
log( ui.item ?
"Selected: " + ui.item.value + " aka " + ui.item.id :
"Nothing selected, input was " + this.value );
}
});
var_dump
( docs ) does not return the dump, it outputs just like echo
. var_dump
( docs )不返回转储,它的输出类似于echo
。 Use print_r
( docs ) with the second param set to true
在第二个参数设置为true
使用print_r
( docs )
error_log ("1) ".print_r($_GET, true));
error_log ("2) ".print_r($_POST, true));
error_log ("3) ".print_r($_REQUEST, true));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.