As a developer, there are certain things I find a bit frustrating about HTML and PHP programming, and this is one of them.
I’m regularly called upon to build shops, or very simple CMS systems with image upload facilities. This is fine, no complaints about that, but when you’re creating a CMS with image uploads, you always need to handle what happens when your user doesn’t upload an image – or what happens if an image is deleted.
Now I know it’s trivial to create an if statement to conditionally show an image or not, but it would be even more trivial if we could just add another attribute to X/HTML <img> tags to allow specifying an alternative image if no image is available. I know we already have the alt tag, to show text or help users with screen readers, but how about something like altimg=”image.gif” as a new attribute? Then you could just set it up once and everytime an image tag is loaded without a src=”" attribute, or the file specified by the src=”" attribute is missing you have a fallback image.
It would mean marginally less typing for me, potentially saving me from the devastating effects of RSI! It could also result in a slightly better end-user experience abolishing those nasty placeholders in IE (and firefox if you have that setting switched on.
Perhaps this has already been suggested elsewhere, I don’t know, and to be honest I haven’t really followed the HTML 5 development so far, so if this (or something similar) is already in there a) please let me know b) great.