0

I have a number of tags on my page where the image src is set by Knockout.js code :

<img itemprop="thumbnail" data-bind="attr:{src: ImageFile}" class="prodimg" alt="Some Alt Text" />

When I run the page through w3c compliance it comes back with :

Element img is missing required attribute src.

Fair enough - I did try a workaround of setting src="#" but that then caused another odd issue (my pages are Asp.net MVC) whereby my controller code was being called twice for each request (see MVC controller is being called twice)

So what can I do to pass w3c compliance, but not have all my code execute twice?!

chilluk
  • 217
  • 2
  • 17

1 Answers1

0

Have sorted this by just pointing my img src to a single pixel image, which is then overridden by my Knockout code - keeps the w3c validator happy also

chilluk
  • 217
  • 2
  • 17