I want to upload an image after fully uploading or uploading the image in a browser. I do not want to show the image while it is loading. Rather, I would like to show a better version of this image until the high quality images are loaded in the background, and when the image is fully loaded in the background, I want to replace the lower quality image with this image.
I have two images let's say
$LQimage = "LQabc.jpg"; $HQimg = "HQabc.jpg";
How can I make it work?
EDIT With the response posted by @codebox, this code worked .. thanks :)
<html> <head> <script type="text/javascript"> function load(){ var img = new Image(); var imgUrl = 'HQabc.jpg'; img.onload = function(){ </script> </head> <body onload="load()"> <img id="pp" src="LQabc.jpg" width=600/> </body> </html>
source share