
This Image Is Also an HTML Webpage - bhalp1
https://dev.to/ben/this-image-is-also-an-html-webpage
======
leepowers
The interesting thing here is the browser renders content of "text/html" as an
image when included as the src of an <img> tag. There's some extra sniffing
going on by the browser to suss out what type of file is being delivered. The
idea, I guess, is that in the wild servers don't always return the correct
content type. Such as a PHP script that outputs a dynamically generated
graphic, but a developer neglects to set the content type.

------
sigvef
You can even cleverly use the image data as a free compressed binary data
store, useful for e.g. reducing file size of single-file demos:
[http://demoseen.com/blog/2011-08-31_Superpacking_JS_Demos.ht...](http://demoseen.com/blog/2011-08-31_Superpacking_JS_Demos.html)

