dongnachuang6635
dongnachuang6635
2016-08-18 21:35

使用Ajax获取已发布的json数据的值

  • json
  • php
  • ajax

When I make an ajax call, I get the ID of my input and I add the id to my json data.

I need to get this id to use it id my success function.

IE : In data id = 1, i need in success to get .qte1

If you have any idea... :)

$('#action-button').click(function() {
    $.ajax({
        type: 'POST',
        url: 'get_qty.php',
        data: {
            'id': $('input[name=qte]').val(),
        },
        success: function(data) {
            $(".qte").html("");
            $(".qte").append(data);

        }
    });
    return false;
});
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换