This is a demo of doing dynamic updates to a page using XMLHttpRequest. Most of the magic is happening in liveUpdater.js. Feel free to do what you like with it. I think it should be usable in plenty of contexts. If you make any improvements to it, especially browser compatibility, I would love to see them (hensleyl@papermountain.org). liveUpdater.css contains the styles used for autocomplete example. You can check out the Ruby code that is powering the back end of this demo autocomplete.cgi, livesearch.cgi, and time.cgi. I've discussed what's going on here in a bit more detail on my blog: Poor Man's Ajax , XMLHttpRequest is your buddy , and Borges gets DHTML .
Type the first few letters of an english word in the text field and pause for a second. You can use the arrow keys and mouse to navigate the list of suggestions. Tab, enter, or clicking will replace the contents of the text field with the selected entry from the list.
Type the first few letters of a word in the text field and pause for a second.
Click the link to retrieve the current time from the server.
Update time