“Bad value for attribute src on element img: Must be non-empty”, for dynamically generated img src

前端 未结 2 1329
滥情空心
滥情空心 2020-12-19 13:26

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

2条回答
  •  渐次进展
    2020-12-19 13:49

    What happens if you just remove the src attribute then add it on the fly when you need it. The src attribute isn't required. And in my opinion I wouldn't worry about what the w3c validation tool says anyway. As long as you test it in the necessary browsers and it works.

提交回复
热议问题