开发者社区 问答 正文

我是javascript新手,只是尝试使用ajax从input获取数据,并附加在我的评论部分

    var comment = $("#commentPost").val();

    if(comment.lenght > 5){}
    $.ajax({
                url: 'home.php',
                method: 'POST',
                dataType: 'text',
                data: {
                    comment: comment
                },
                success: function (response) {
                    $("#commentPost").val("");
                    $(".commentRow").hide();
                    $('.commentRow').parent().next().append(response);
                }
    });

展开
收起
社区秘书 2019-11-27 16:17:58 719 分享
分享
版权
举报
阿里云 AI 助理回答

[203] :api鉴权失败

有帮助
无帮助
AI 助理回答生成答案可能存在不准确,仅供参考
0 条回答
写回答
取消 提交回答
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等