Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 替换消息,而不是插入后面的消息_Javascript_Jquery - Fatal编程技术网

Javascript 替换消息,而不是插入后面的消息

Javascript 替换消息,而不是插入后面的消息,javascript,jquery,Javascript,Jquery,我有一段代码,在上传后显示一条html消息,但我想替换这些消息,而不是累积一个消息列表,如: 有效图像 无效图像 无效格式 成功上传 有什么想法吗 谢谢每次使用DIV并替换内容 $('#userfile').change(function() { $(this).upload('xxx.php', function(res) { $("#someDivID").html(res); }, 'html');

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

有效图像 无效图像 无效格式 成功上传

有什么想法吗


谢谢

每次使用DIV并替换内容

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