dtcd27183 2013-11-18 08:58
浏览 30
已采纳

如何将值传递给ajax中的php页面

i am trying to pass the value to the deleteslide.php page in this code. Here i am getting the values from dropdown list and i am assigning it to variables.

Now i want to pass that variable values to deleteslide.php page.

Here is what i have tried...

But this is not working properly

 $("#deleteslide").click(function()
        {
            var prjid=document.getElementById("pj-list").value;
            var unitid=document.getElementById("ut-list").value;
            var slidid=document.getElementById("se-list").value;
               var d ='deleteslide.php?projectId='+pj-list+'&unitNo='+ut-list+'&slideNo='+se-list+'';
                $.ajax({                   
                url:d,                                           
                success:function(output)
                {              
                    alert(output);              
                }           
            });
        });

How can i do this?

  • 写回答

4条回答 默认 最新

  • duannuochi3549 2013-11-18 09:00
    关注

    Try to write the URL like

    var d ='deleteslide.php?projectId='+prjid+'&unitNo='+unitid+'&slideNo='+slidid;
    

    You are passing wrong values which are not defined. And your ajax call will be GET method like

    $.ajax({                   
            url:d,                                           
            type : 'GET',
            success:function(output)
            {              
                alert(output);              
            }           
        });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择