XMLHttpRequest is impressive Dec12 '04

Sometimes you get answers when you least expect them. For me, I have been wondering how certain form validation actually works, without reloading the page.

Well... it turns out that XML HTTP is the answer.

WHat?

OK... let’s back up a sec. Since I am still coming to grip with this technology myself, I feel it would be best to explain things carefully.

When filling out web forms, or just interacting somehow on a web page – ever notice how some information changes, after you have made a selection of some sort? And that change occurs without the page reloading?

Gmail is a great example. If you use Gmail, you’ll know what I am talking about. If you don’t use Gmail – start using Gmail. Consider it. The features are incredible.

In any case, the process happens so quick and smoothly, it’s hardly noticeable.

For example, let’s say I have two select lists on a web page:

This will not work with these select lists, but pretend for a sec. Depending on which band I select in the first list – the songs should change accordingly in the second list – without the entire page having to reload.

This is XML HTTP.

Another example

If you haven’t seen it already (I’m sticking with Google), head over to Google Suggest, and type something into the search box.

What happens?

As you’ll notice, a drop down select list is displayed, with search options that match the letters that you type. In a way, it saves you an entire step. You can instantly see common searches, and that saves you the time of having to keep searching over and over.

This is XML HTTP.

How’s it work?

What’s actually happening is that small queries are being submitted behind the scenes, and after the page has loaded – with some help from JavaScript.

For web developers, this has great implications.

Benefits

The most obvious benefit is that XML HTTP reduces constant calls to the server.

And for something like Google, which usually coughs up some 6 million results for a single word, the "reduced server pushing" is a huge plus.

The other major benefit is web forms. Picture those huge, time–consuming web forms that always needed to be filled out right before lunch. Who has time for all that?

Well... you’ll still need some time, but XML HTTP will make things a lot easier.

Some form fields will be automatically filled in, depending on information that you provide in nearby form fields.

A good example of that is City, State, and Zip Code fields. If you supply the city and state, why can’t the zip code be automatically inserted?

Resources

For now, this write–up barely scratches the surface of XML HTTP. However, some great minds have already stepped up and discussed it, in much more depth:

Categories: Programming , Web Development

Add Feedback (view all)

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

Google is doing it (and GMail has been for a while now). I'm not sure how it works myself yet ... Read more.

I wish we all had more time to "play." December sucks. ... Read more.

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

Stats

2 unique visits since November 2008

Syndicate

Advertisements