https://johnresig.com/blog/embedding-and-encoding-in-javascript/
This link is now broken.
about:
All of the game contents are embedded within the game script: This includes all game sprites and music.
This is an interesting feat and one that's possible to accomplish within your own code. Let's take a step through how this was done to understand how we can better use this within our own sites.