Tuesday, February 10, 2004

Dynamically updating HTML pages from the server

I have just been reading about dynamically updating parts of the HTML page using XMLHttpRequest.

Basically you write some code that on_click sends an XMLHttpRequest back to the server. When the responce is recieved it looks for XML entries with ids that match ids on your page, then overrights the matching parts of your page with the content of the matching XML segment. This has the effect of allowing the server to update any part of a page dynamically without refreshing the whole page.

Pretty cool. The aim is to limit the amount of javascript you have to write. One other aspect was a live Updater.. where the page sends regular requests to the server, and so keeps updating. You could get live search results...etc. :)

No comments:

GitHub Projects