I have typed in below code in my page:
var img = new Image();
img.src="abc.jpg"
abc.jpg is a pagecounter which helps me to count the pageview once it is loaded. For this case, I only create the img element, but doesn't add it into DOM.
Is the image downloaded into user's page? Or I must needed to add it into DOM?
Thanks a lot.
================================================================
In order to make the things more clear, here provides a demo page: http://ad3.guruonline.com.hk/mobmax/testing/stackoverflow.html
This page is referencing a JS file "stackoverflow.js":
And for stackoverflow.js, it creates a variable "img" which points to "stackoverflow.jpg"
So, I go back to stackoverflow.html, and view the "network" tab : the most surprising is, stackoverflow.jpg is actually downloaded!
Accoridng to KK's answer, stackoverflow.jpg shouldn't be downloaded, right? Because I never add it to DOM. Can someone provide a explanation on this scenrio?
Thanks!