Brief introduction to Ajax
By creating an instance of this class a POST or GET request can be sent to the server and the response is stored in a property ('returnedText') of the communication object. It's become widely customary to encode these responses in XML messages. You can invent your own message structure (either based on XML or anything else), but one has to be aware that if the http headers are properly set and the message returned to the client is a well formed XML fragment, also the property XMLResponse is assigned with a reference to an object that represents the DOM of the XML response. By means of the XML W3C DOM interface the programmer can easily manipulate the data embedded in the XML message.
Browsing a database of classical music composers
In this example a Rivet script fills a Tcl dictionary with the essential data regarding a few of the major composers of the european music. This dictionary plays the role of a database. The script sends back to the client two types of responses: a catalog of the composers or a single record of a composer.
This example requires Tcl8.5 or Tcl8.4 with package 'dict' installed