jquery动态添加图片路径不刷新问题

来源:互联网 发布:办公软件的运用 编辑:程序博客网 时间:2024/05/16 15:37

页面:<div id="img" style="text-align: center;margin-top: 20px"></div> 

script:

var html = "<img src='${ctx.contextPath}/img/readIcon?ticketid="+uuid+"&t="+Math.uuid()+"'width='80px' height='60px'></img>";
        $("#img").append(html);

js更新img路径后,页面图片不刷新,是因为原路径与上传路径相同浏览器默认缓存,添加随机数Math.uuid()(自己找的工具类)。

原创粉丝点击