new Image().src资源重复请求问题

const img = new Image();
img.setAttribute("crossOrigin", 'Anonymous');
img.src = url + '?t=' + new Date().getTime();
imgBg.onload = function() {}
请求路径后面增加new Date().getTime(),防止浏览器重复请求相同资源
原文地址:https://www.cnblogs.com/peter-web/p/10773968.html