I want to change the image when clicking.
var view = 5; var url = '/images/'+view+'.jpg?'+random; $('#popup').find('img').attr('src', url); The problem is that the url of the image is replaced immediately, and the browser updates the image only after a few seconds. How to make an image immediately on click. It is possible to insert a loader somehow, and wait for the image to load.