开发者

replace a message and not insertAfter

开发者 https://www.devze.com 2023-02-25 17:42 出处:网络
i have this code that shows an html message after the upload, but i want to replace the messages and not accumulate a list of messages like:

i have this code that shows an html message after the upload, but i want to replace the messages and not accumulate a list of messages like:

valid image invalid image invalid format success upload ....

  $('#userfile').change(f开发者_StackOverflow中文版unction() {
                $(this).upload('xxx.php', function(res) {
                    $(res).insertAfter(this);
                }, 'html');
            });

any idea?

thanks


Use a DIV and replace the content every time

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

精彩评论

暂无评论...
验证码 换一张
取 消