How it works:
The game consists of three files:
- tictactoe.html is a HTML 5 file with an embedded SVG graphics representing the playfield.
- jquery which is linked in directly from the google CDN
The code in tictactoe.js is using jQuery to hide and show the O’s and X’s in the playfield as the game proceeds.
jQuery is a java script library which makes it easy to manipulate the DOM, i.e. the structure of the document while it is being displayed in the browser. It also abstracts away differences between different browsers. Google hosts several versions of jQuery so you dont even need to have it on your server, only a reference to the google hosted copy is needed. This has the further advantage that the library is possibly already cached when the user has used a different site with jQuery before.