jquery.post()和php

and*_*ins 1 php jquery

我正在使用$().post和php来改变<textarea>的内容.

脚本正在成功 - firebug清楚地显示textarea标签之间的文本已经改变,我的小警报触发.

但是,用户看不到更改.在Firefox中,根本不会发生变化,而在IE中,textarea最迟会更新10秒.

这是我正在使用的jquery:

$(document).ready(function() {
    $('#pv_list li:first').addClass('hilite');
    $("input[name='db_entries']:first").attr('checked', 'checked');
    $("input[name='db_entries']").click(function () {
        $.post("changeEntry.php", {post: $(this).val()}, function(data) { 
            $("textarea").text(data);alert('done');
        });
        $('#pv_list li').removeClass('hilite');
        $(this).parent().addClass('hilite');
    });
});
Run Code Online (Sandbox Code Playgroud)

起初我以为是因为页面没有验证,但它验证了xhtml过渡.

真正烦扰我的是我让它早点工作,无法弄清楚我改变了什么.

Sam*_*son 5

设置.val()的,而不是.text()

Stackoverflow存档:

  • +1"Stackoverflow Archive"格式.:P (2认同)