Server does not receive data from ajax call

后端 未结 2 839
伪装坚强ぢ
伪装坚强ぢ 2021-01-27 13:21

I have a problem. I\'m trying to send content of a textarea with an ajax call, but it doesn\'t seem to be working, and I don\'t know why.

There\'s the method called

2条回答
  •  遇见更好的自我
    2021-01-27 13:55

    Try this:

    $("#btnSaveStatus").on("click", function () {
                        var statusText = $(".textareaEdit").val();
                        var jsonText = new Object();
                        jsonText.statusText = statusText;
    
                        $.ajax({
                            type: "POST",
                            url: "Default.aspx/GetStatus",
                            data: JSON.stringify(jsonText);,
                            contentType: "application/json; charset=utf-8",
                            dataType: "json",
                            success: function (result) {
    //                            $('#littlbioID').text(result.d);
                            }
                        });
                    });
    

提交回复
热议问题