I have a web site with an image slider. I keep the some of the image tags empty as the images load on when slide comes into view for faster page load. The image tags defined as follows:
<img data-src="img/portfolio-desktop1-small.png" src="" alt=""/>
What I'm doing is on slide function I change the src
to data-src
with jQuery animation. The slider works great. My problem is when I try to validate it in w3c validation tool it gives the following error:
Line 131, Column 179: Bad value for attribute
src
on elementimg
: Must be non-empty....data-src="img/portfolio-desktop1-small.jpg" src="" alt=""/>
Syntax of URL:
Any URL. For example:/hello
,#canvas
, orhttp://example.org/
. > Characters should be represented in NFC and spaces should be escaped as%20
.
Is there anyway to fix this without altering the JavaScript or CSS? If I leave it like this what can be the possible harmful outcomes of this matter?
src
gave me the a different error which is: >Line 131, Column 172: Element img is missing required attribute src. though I guess I have to agree with you that at the moment w3c validation is not good enough to worry right now. – Protective