Re:A file that's both an acceptable HTML page and a JPEG (vi...
by seanconaty on Friday July 06, 2012 @03:17PM
(#4209224)
Any practical use for this or just for fun?
[ Parent
| on HN ]
Re:A file that's both an acceptable HTML page and a JPEG (vi...
by naugtur on Friday July 06, 2012 @04:21PM
(#4209459)
I posted my comment right before spotting your question... I Used a trick like that to be able to load my posterous posts with JSONP. http://zbyszek.posterous.com is loaded as content in http://naugtur.pl
Re:A file that's both an acceptable HTML page and a JPEG (vi...
by septerr on Friday July 06, 2012 @05:19PM
(#4209696)
Please explain~
(I can tell the magic is happening in fun.js and I could figure it out if I spend some time on it, but wouldn't mind the explanation handed to me on silver platter.)
http://zbyszek.posterous.com - the theme for this, did you create it? It's neat. There are a pair of forward slashes at the beginning of the page though. In Chrome at least.
http://naugtur.pl - Love the categorization and of course the animation. What are you using to do the animation?
Thanks~
Re:A file that's both an acceptable HTML page and a JPEG (vi...
by naugtur on Friday July 06, 2012 @05:32PM
(#4209761)
my posterous page starts with two slashes. They are discrete and they allow me to put JS code in a HTML comment. If you look at the source, you'll notice that when interpreted as JS it feeds a big array to window.posterousCB(). The rest is plain ond JSONP - define the global function first, and then load external cross-domain resource that runs the function with data.
As for animations - It's just a CSS transition definition and a single rule to rotate and scale an element. I created a hack that makes the CSS rule apply recursively. fun.js has some code that converts the simple html into a deeper structure.
I think someone else got the idea of _recursive CSS_ first, but it was used for drawing shapes as far as I remember.
Re:A file that's both an acceptable HTML page and a JPEG (vi...
by pubby on Friday July 06, 2012 @03:55PM
(#4209349)
There was a 'virus' that spread on 4chan years ago that did something like this. AFAIK when saved as a .js file and run it would post itself back 4chan to continue spreading.
Re:A file that's both an acceptable HTML page and a JPEG (vi...
by JamesLeonis on Friday July 06, 2012 @04:36PM
(#4209532)
For a "positive" 4chan use, this allowed people to concatenate zip files at the end of jpegs to make "books". It was common to use a picture of a book, and then concat the book in a zipped pdf or other text file and then post it.
Re:A file that's both an acceptable HTML page and a JPEG (vi...
by newaccount2 on Friday July 06, 2012 @10:19PM
(#4210493)
The best part about that virus was it also zipped up a random file from your pc to upload along with it. Everyone in /g/ was grabbing for these things. Can you say identity fraud.