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条)

报告相同问题?