The JS that's doing the work is at http://imgs.xkcd.com/static/waldo.js. On page load, it sends a GET request to http://umwelt.xkcd.com/story/ghenkEggov8 with params w for the browser width in pixels, h for the height and r with the referrer. The rest of the qualifiers (geoloc and browser (user-agent)) can be determined on the server-side.
As a response, you get back JSON with the alt-text, image URL, and positioning info, which is then used to fetch and position the image.
Fun fact: the server-side is written in Haskell:
$ wget -S http://umwelt.xkcd.com/story/ghenkEggov8
--2012-04-01 11:26:41-- http://umwelt.xkcd.com/story/ghenkEggov8
Resolving umwelt.xkcd.com... 188.8.131.52
Connecting to umwelt.xkcd.com|184.108.40.206|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Well done Randall and davean.
Valid for today: http://xkcd.com/
And oddly, got the Jersey comic from my Dallas-based Linode https://skitch.com/constantinexvi/8q5m2/xkcd-umwelt-chromium
alt text is "Umwelt is the idea that because their senses pick up on different things, different animals in the same ecosystem actually inhabit very different worlds."
My favorite most definitely is the military one: http://imgs.xkcd.com/a1panels/961f9f87076b08c0d29f9182d6e1b3...
Apparently he's still changing things - people who complain on the forum thread have noticed a few hours later that relevant fixed have been made.
(Also, I wonder how much was done by rpm and how much by davean.)
It gives people a taste of the "post-PC" world we are evolving towards. And there are some deeper stuff, too.
Well done XKCD guys (and gals).
title="Umwelt is the idea that because their senses pick up on different things, different animals in the same ecosystem actually live in very different worlds. Everything about you shapes the world you inhabit--from your ideology to your glasses prescription to your web browser."