替换消息而不是insertAfter

时间:2011-04-15 23:38:03

标签: javascript jquery

我有这个代码在上传后显示一条html消息,但我想替换消息而不是累积消息列表,如:

有效图片 图像无效 无效的格式 成功上传 ....

  $('#userfile').change(function() {
                $(this).upload('xxx.php', function(res) {
                    $(res).insertAfter(this);
                }, 'html');
            });

任何想法?

感谢

1 个答案:

答案 0 :(得分:1)

使用DIV并每次都替换内容

$('#userfile').change(function() {
            $(this).upload('xxx.php', function(res) {
                $("#someDivID").html(res);
            }, 'html');
        });
相关问题