< a href = " http://codepen。io/neoRiley/pen/dXGgQe" rel="nofollow"> code depen LESS example . io/neoRiley/pen/dXGgQe" rel="nofollow"> code depen LESS example
解决方案我发现< A href="https://bugs.chromium.org/p/chromium/issues/detail?id=7731#c12" rel="noreferrer">https://bugs.chromium.org/p/chromium/issues/detail?id=7731#c12
(此代码直接取自注释)
var photo = document.getElementById('image_id');
var img = new Image();
img.addEventListener('load', myFunction, false);
img.src = 'http://newimgsource.jpg';
photo.src = img.src;