Skip to main content

Blog Archive for driscoll during May 2008

Here's the Comet TicTacToe that I went over in my BOF on Comet on Wednesday night. It's pretty simple (though not as simple as my first example, or even the somewhat improved version) - just 200 lines of Java code (including the game logic), 50 lines of JavaScript (embedded in an HTML page), 50 lines of HTML, and a 75 line CSS file. Simple stuff, but if you're looking to write your own Comet...
In my previous blog, I mentioned that I didn't like the hack of reloading the iframe via the post action - it's hacky, and it's not hard to imagine it messing things up in a more complex program. Turns out the answer is both easy and blindingly obvious once you think of it: the iframe onload event. And while we're add it, we'll add a onerror event too. In my previous program, I had had a...
I was looking at a recent blog by Shing Wai Chan and going through the Comet example, when I noticed that the example wasn't working correctly. Although he updated his example to get around that problem, I was still a bit unsatisfied, and decided to sit down, using his basic example, and see if I could make it even simpler. I've whittled it down to about 100 lines, and only 2 files, and I...