Posted 2009-04-21 in Webmaster
XMLHttpRequest is a scripting object that provides an interface for client-server requests. XMLHttpRequest originated with Internet Explorer 5, was eventually picked up by Mozilla, and is currently a W3C working draft specification. You can actually fetch data from a file, FTP server, and other protocols not limited to HTTP.
There are already some good simple examples of using XMLHttpRequest, and more in-depth implementations with better browser compatibility and structure. For Firefox extension developers the MDC describes using XMLHttpRequest in Mozilla/Firefox with lots of detail, and in a format suitable for add-on developers.
There are some distinct advantages of transparent client-server requests in Web applications. Instead of making a full GET or POST request and reloading the page, you can fetch data from multiple sources in the background. You can present live updating data on a Web page or toolbar. Most importantly, you can spare your users the frustration of waiting around and enhance the entire user experience.
Browser compatibility with XMLHttpRequest varies, but most modern browsers support some implementation of it. Always try to have a fallback in place for those who have incomplete or buggy browsers.
Subscribe via RSS
Stay current with Scriptalicious news and subscribe in your favorite RSS reader.
Get the latest Scriptalicious news delivered to your inbox.
77 powerful SEO scripts for under $100.
Real-time Backlink Rank Checker script.