jquery POST data in aspx page

后端 未结 2 1893
失恋的感觉
失恋的感觉 2021-01-28 02:18

I post data to my aspx file qith the following code:

 $.ajax({
            type: \'POST\',
            url: \"Ajax_Text.aspx?rand=\" + myRand
                            


        
2条回答
  •  隐瞒了意图╮
    2021-01-28 02:30

    POST data are not send in query string but added to the request body. Try this code:

    $.ajax({
            type: 'POST',
            url: "Ajax_Text.aspx",
            data: {'rand': myRand, 'id': $(".articleID").attr('title'), 'text': $("#text").val()},
            cache: false,
            beforeSend: function () {
    
            },
            success: function (data) {
                alert(data); 
            }
        });
    

提交回复
热议问题