AJAX: It's not just for cleaning your toilet.
10 11 2005
AJAX is cool. I'm not entirely sold on the fact that it's absolutely necessary, but it definitely is neat.
So what on this blue globe is AJAX do you ask? Well, first of all, it's not just a household detergent. Its an acronym that stands for Asynchronous Javascript And XML. What it does is give you the ability to communicate with a webserver from a webpage without resending the page request or submitting a form.
For those who aren't web programmers (basically anyone who reads this blog), the web is what is called stateless. All that means is that when you open up a page in a web browser, a request is sent to the server at the other end, and the server sends the page you are looking for back to your browser for display. Once that transaction is complete, all bets are essentially off. Your next request will have absolutely no relation to the one before. That's why cookies were invented to hold data for use between pages. It's also why you see almost entirely static web pages: any data you need for a page needs to be loaded ahead of time before a page is rendered in a browser.
Well, some folks have found a neat way around this: AJAX. What it does is give you the ability to send requests to a webserver AFTER a page has been loaded using what is called the Javascript XMLHttpRequest object.
An example of this idea would be in something I just built for Picasso (my Intranet portal at work) -- the new corporate directory. AJAX seemed to be a good solution to this problem. I needed to show everyone in the company categorized by organization and sub-categorized by department, and this is a rather large amount of data to pull all at once and try to jam into the loading of a page. With AJAX, I was able to break up the processeing into discreet chunks:
Example: at the inital page load, the server grabs a list of all the organizations in the company and displays them. Once a user clicks on an organization, the XMLHttpRequest object opens up a request in the background for a list of all sub-departments. It waits for an XML response And builds the list of sub-departments. Seamlessly. Without rereshing the page. On the fly.
This may seem a bit esoteric, but in practical use it is very slick. I'll try to put up an exampke of it in action.
Comments :
6 Comments »
So what on this blue globe is AJAX do you ask? Well, first of all, it's not just a household detergent. Its an acronym that stands for Asynchronous Javascript And XML. What it does is give you the ability to communicate with a webserver from a webpage without resending the page request or submitting a form.
For those who aren't web programmers (basically anyone who reads this blog), the web is what is called stateless. All that means is that when you open up a page in a web browser, a request is sent to the server at the other end, and the server sends the page you are looking for back to your browser for display. Once that transaction is complete, all bets are essentially off. Your next request will have absolutely no relation to the one before. That's why cookies were invented to hold data for use between pages. It's also why you see almost entirely static web pages: any data you need for a page needs to be loaded ahead of time before a page is rendered in a browser.
Well, some folks have found a neat way around this: AJAX. What it does is give you the ability to send requests to a webserver AFTER a page has been loaded using what is called the Javascript XMLHttpRequest object.
An example of this idea would be in something I just built for Picasso (my Intranet portal at work) -- the new corporate directory. AJAX seemed to be a good solution to this problem. I needed to show everyone in the company categorized by organization and sub-categorized by department, and this is a rather large amount of data to pull all at once and try to jam into the loading of a page. With AJAX, I was able to break up the processeing into discreet chunks:
Example: at the inital page load, the server grabs a list of all the organizations in the company and displays them. Once a user clicks on an organization, the XMLHttpRequest object opens up a request in the background for a list of all sub-departments. It waits for an XML response And builds the list of sub-departments. Seamlessly. Without rereshing the page. On the fly.
This may seem a bit esoteric, but in practical use it is very slick. I'll try to put up an exampke of it in action.
Categories : Tech
Trackbacks : No Trackbacks »
I don't know how I missed this last April 22, but 2003 is the ten-year anniversary of the release of 



