Sun Tzu A Day

My Hypertext rendering of Sun Tzu’s The Art of War proved quite popular. This lead me to play around a bit more and produce a piece of server-side script that each day produces a piece of client-side script (changing at midnight according to this server’s clock), that puts one verse onto a webpage.

The results look a bit like what appear on this page. Note that it’s easy to change the style using CSS.

The produced HTML is all contained in a div with a class of “sunTzuADay”.

The main piece of text is inside a div with the class “sunTzuContent”. The attribution is inside a p with the class “sunTzuAttribute”. Foreign words are put inside a span with the class “foreign”. Some of these are inside yet about span with the English translation in the title.

In all the following elements are used (some will not be used every day).

To put it on a page you just need a piece of code like this:

<script type="text/javascript" src="http://www.hackcraft.net/SunTzu/day/script/"></script>

You are free to do so. If you really want to get rid of the attribution using CSS then go ahead (though I'd prefer you left it).

Jon HannaSkip Buttons This work is licensed under a Creative Commons License. Email Me PGP Key Foaf Document Orkut Profile Hacker Amazon Wishlist Thinkgeek Wishlist

Valid XHTML 1.0 Valid CSS UTF-8 Encoded
Amazon.com Associate Amazon.co.uk Associate
Viewable in any browser Best viewed at a resolution you like!
Coded By Hand Uploaded Using Filezilla