Fragment identifiers? Shut up! Polling? Get out! The demo has now been refactored to use the Julien Lecomte's excellent hack. The trick is to dynamically generate iframes, whose sole purpose in life is to make a call - after loading, it makes a call and then it expires, just like Phiedippides' dedicated effort in the first ever Marathon. So imagine a window (top-level or iframe) in domain A that wants to call another window (top-level or iframe) in domain B. It does so by spawning a new window in domain B, with CGI parameters reflecting the call to be made. Since domain B *wants* to co-operate, this new window is designed to look at its URL on startup and call the other window in document A with arguments from the URL. More specifically...

Changing colour. When you submit a new colour, the top-level ajaxify window spawns a new iframe ajaxpatterns.org/../front.php, which then calls its same-domain buddy in the sibling iframe ajaxpatterns.org/../content.php, using parent.frames["serverContent"].changeColor(bgColor);.

Changing speed. When you hit a "change speed" button, the ajaxpatterns content iframe spawns its own iframe pointing to ajaxify.com/../front.php. This a grandparent of the top window, and happily enough they're both at the same domain, so they can actually call each other..

  
Pick a color, any color: