Adaptive Images for Responsive Designs

Jake Archibald stellt a dirty, dirty hack… that works für Bilder in Responsive Designs vor.

Das Ziel ist eine Lösung die auch ohne JavaScript funktioniert.

<script>document.write('<' + '!--')</script><noscript>
    <img src="image.jpg">
<noscript -->

And there we have it. We can now prevent images loading for users with JavaScript, but we can still get at the markup. Now all we need to do is give each of our dirty scripts a class name, then JavaScript can pick them up, grab the markup from the comment and decide what to do with the images.

In der Tat ein Hack, aber ein sehr spannender;-)