weixin_33725807 2016-01-29 11:37 采纳率: 0%
浏览 25

php jQuery动态下拉列表

I am having problem sending/reading ajax variable.

Ajax code is as below:

$.ajax({
    url: "/wp-content/themes/canvas-child/get-clients-dropdown.php?it=1",
    success: function(data) {
        $("#ClientID").html(data);
    }
});

I have tried to read it in another php file like this:

$InvoiceType = $_REQUEST['it'];
//$InvoiceType = $_POST['it'];
//$InvoiceType = $_GET['it'];

But none of above works. The variable $InvoiceType always stays empty.

What is the problem?

  • 写回答

4条回答 默认 最新

  • weixin_33736832 2016-01-29 11:45
    关注
    $.ajax({
          type: "GET",
          data: {it: "1"}, 
          url: "/wp-content/themes/canvas-child/get-clients-dropdown.php?it=1",
          success: function(data) {
             $("#ClientID").html(data);
          }
    });
    

    try this

    评论

报告相同问题?

悬赏问题

  • ¥15 三菱变频器模块怎么检测触发
  • ¥15 在C#方法中使用了.Refresh();刷新了控件,但是不是最新值
  • ¥30 求一下解题思路,完全不懂。
  • ¥30 关于#硬件工程#的问题:求一下解题思路
  • ¥15 运筹学对偶单纯行法构造扩充问题
  • ¥20 XP系统的老电脑一开机就提示找不到rundll.exe,付费求解
  • ¥15 milvus查询出来的score怎么转换成0-1之间的相似性
  • ¥15 lvgl V9移植到linux开发板
  • ¥15 VB.net中在窗体中创建一个button控件来关闭窗体,但是提示错误,我该怎么办
  • ¥15 网上下载好的程序但是arduinoIDE编程报错,运行不了,哪里出错了,能具体给改一下吗