XMLHttpRequest Demo

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 .

Autocomplete

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.

blah

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum viverra ligula a mi. Phasellus accumsan nibh ut purus. Nulla pharetra augue quis tellus. Phasellus porta nonummy eros. Ut arcu. Donec vehicula, wisi eget consequat porttitor, diam mi mattis ligula, non consequat orci est sed purus. Proin adipiscing risus nec est. Duis purus mi, hendrerit a, egestas at, congue quis, libero. Maecenas wisi. Donec vel tellus in lorem interdum elementum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam sed diam. Suspendisse fringilla, odio a rhoncus tincidunt, sapien arcu euismod wisi, id ultrices lectus lectus sit amet mi.

Live Search

Type the first few letters of a word in the text field and pause for a second.

Live Action

Click the link to retrieve the current time from the server.

Update time

Time of last click