weixin_33696822 2017-07-10 19:12 采纳率: 0%
浏览 157

AJAX中的GET请求变量

for my page

www.domain.com/page.php?x=1&y=2&z=3

how can i set the $_GET variables inside the AJAX $.get()?

$.get('page.php',
{x: x, y: y, z: z},
function(){
})

how do i define the $_GET using jQuery or JavaScript? i can have 1 2 3 and 4 5 6 and 7 8 9

  • 写回答

3条回答 默认 最新

  • weixin_33682719 2017-07-10 19:19
    关注

    you can assing the value at a var or assign directly

    var x = 10;
    var y = 100;
    var z = 1000;
    $.get('page.php',
      {x: x, y: y, z: z},
       function(){
     })
    

    or

    $.get('page.php',
      {x: 10, y: 100, z: 1000},
       function(){
     })
    
    评论

报告相同问题?