From Ajax Patterns
The point is to avoid a full page refresh, while allowing the browser to make a query or upload some data. As the Alternatives section of XMLHttpRequest Call shows, there are actually quite a few ways to do this. The three patterns here are the most useful and the most common. They are competing mechanisms; each essentially achieves the same goal of web remoting, but in different ways:
- XMLHttpRequest Call is by far the most popular technique, and for good reason: XMLHttpRequest is built for the precise task of Web Remoting.
- IFrame Call is more of a hack and a relic from the pre-Ajaxian era when XMLHttpRequest was not yet available. IFrames weren't really designed with Web Remoting in mind, but there remain several situations where IFrame is the superior choice.
- HTTP Streaming, also known as "Server Push", differs from other approaches because the server continues to push new data down the pipe, without the browser having to issue new requests. As with IFrame Call, HTTP Streaming does stretch the technology beyond what was originally envisioned, but it also has the distinct advantage of optimising refresh times.