OnClick Send To Ajax

后端 未结 2 1141
眼角桃花
眼角桃花 2020-12-15 14:47

I\'m trying to complete some ajax requests to insert a textarea into a database without refresh. Here is my code:

HTML:



You have few problems with your code like using . for concatenation

Try this -

$(function () {
    $('input').on('click', function () {
        var Status = $(this).val();
        $.ajax({
            url: 'Ajax/StatusUpdate.php',
            data: {
                text: $("textarea[name=Status]").val(),
                Status: Status
            },
            dataType : 'json'
        });
    });
});

提交回复
热议问题