简体   繁体   English

如何使用jQuery UI remote获得服务器端参数?

[英]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_dumpdocs )不返回转储,它的输出类似于echo Use print_r ( docs ) with the second param set to true 在第二个参数设置为true使用print_rdocs

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.

相关问题 使用 Jquery 获取服务器端分页 - Getting Server-side pagination using Jquery 服务器端事件-如何将参数传递给服务器端脚本? 附加查询字符串? - Server-side event - how to pass parameters to server-side script? Append query string? 如何为ui.suggest配置dataFeed和服务器端过滤? - How to configure dataFeed and server-side filtering for ui.suggest? 获取DIV的内容并保存到文件,jQuery / JS或服务器端 - Get the content of a DIV and save to a file, jQuery/JS or Server-side 如何使用jQuery DataTables插件实现服务器端处理? - How to implement server-side processing with jQuery DataTables plugin? 如何通过服务器端身份验证获取用户访问令牌 - How to get user access token though server-side authentication 如何使axios使用服务器端缓存? - How to get axios to use server-side caching? 如何在服务器端处理数据表中获取包含(')的varchar? - How to get a varchar which contains a (') in server-side processing datatable? 如何使用Jqgrid进行服务器端验证? - How to do server-side validation using Jqgrid? 如何使用服务器端处理数据表连接 2 个表 - How to Join 2 Tables using Server-Side Processing DataTables
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM