- Demo URL (check the source): http://scottjehl.com/picturefill/
- Code on Github: https://github.com/scottjehl/picturefill
So, is it responsible to suggest that developers might use something like this today, given that it provides a workable solution to this very real problem, even if the markup is not yet standard or supported natively anywhere? I’m certainly attracted to the idea, given how hard it is to do this through other means. Perhaps it’d even encourage browser implementations more if the pattern gained traction like this, I’m not sure.
A native implementation would still of course allow image sources to be fetched immediately when the document is parsed, but as a fallback polyfill for today, I think I’m comfortable with the advantages that this slightly ugly workaround brings.
* The noscript idea here isn’t entirely new… Head London cleverly proposed it a while back. For some reason, it feels a little more purposeful to me when the noscript is used as fallback content in a picture element.