4 ms·
Your trick doesn't work for me in Firefox 96 :) One more: If you set an image's src attribute to the same thing, it'll still reload the image. const image =
by tentacleuno 5y ago
Your trick doesn't work for me in Firefox 96 :)
One more: If you set an image's src attribute to the same thing, it'll still reload the image.
const image = new Image("/img.png");
document.body.append(image);
image.src = image.src;
- greggman3 5y agoIt might not actually reload the image but it has to fire all the events as though it did otherwise code would hang.
- tentacleuno 5y agoIt does reload the image in Firefox at least. I just tried it.
- MatmaRex 5y agoOh, it works, it's just cheekier than you think - it won't refresh the page if the URL includes a hash/fragment (such as after you clicked one of the "next" links while browsing comments here).