Hacker News new | ask | show | jobs
by zdragnar 900 days ago
That's feasible in XHTML, but it don't think it's in the html5 spec.

Instead, you can use a data URL, though you'll be wasting bytes specifying the mime type and base64 encoding the rest.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_...

1 comments

That’s the one! Data URL! Thanks. :)

The primary way we used it was as the body of a tracking gif, returned as binary. But we also used it as a spacer here and there inline in HTML using the data URI. When embedding in HTML the file size is mostly relevant for brevity.

Wow, that takes me way back.