|
|
The New Age of the Internet: Efficient Surfing with Ajax
David McClellan, Technology Coordinator
Ajax. Google uses it. Insala uses it.
Microsoft embraces it. AOL and Yahoo are also on board. What
is this new technology that everybody is talking about?
Well, it’s not a new technology at all. The term “Ajax” is
just a label slapped on an old methodology. Web developers
have been creating web applications with this for the better
part of a decade. Ajax is a marketing tool that has created
a newfound interest in this technology. I’m glad that its
new face is helping it to pick up steam. And it’s about
time. This technology has the potential to shape the World
Wide Web into a completely different animal.
You must first understand the nature of the internet to
appreciate the value of Ajax. For the most part, the
internet is based off web servers interacting with browsers.
For example, you would run a browser from your computer at
home to surf the internet. You would interact with, let’s
say, Yahoo’s web servers. Every time you click on a link or
a button, the browser refreshes with a new page or new
content. Ajax is simply a way for a browser to communicate
with a web server in an extremely efficient manner.
Web pages have traditionally been limited in functionality.
They are generally restricted to single page requests. The
first thing that happens when you visit a web site is the
browser calls the web server requesting information. This
request contains a variety of data, including the URL and
information about your computer. The server processes the
request and the entire resulting page is sent from the
server back to your computer. The bottleneck created by the
sending of information back and forth over the internet is
the main reason some web applications run slowly. When you
have a lot of content and code on a page, it may take more
than a few seconds to bring up a web page. Every action
performed on the page will require all of that information
to be sent to your browser again, regardless of how little
changed.
What if there was a way to retrieve just the data that you
need from the server without having to refresh the entire
page? This is where Ajax comes into play. A recent article
by Jesse James Garrett, the founder of Adaptive Path
Technologies, coined the acronym “Ajax”, which stands for
Asynchronous JavaScript and XML. Ajax is not a language or
technology itself. It is the act of using XML-based Http
requests inside client-side JavaScript. This technology has
been available for a while. It was invented over 7 years ago
by Microsoft and released with Internet Explorer 5.0.
Let’s look at a practical example of how Ajax can help.
Let’s say we had a drop down list on a web page with a list
of countries, and below the list of countries, we have
another dropdown list with a list of states. When a user
selects a different country from the drop down list, we want
the list of states to be updated with the states within the
selected country. In order to make this work, we would
either have to store the entire database of countries and
states in the user’s browser, or retrieve the state list
from the web server each time the country changes. The first
option wouldn’t be practical because the page would take too
long to load initially. If we analyze the second option,
we’ll see that we have two more choices. To retrieve data
from the server, we could call the server and request the
entire page again, causing the page to refresh entirely. Or,
we could use Ajax to only retrieve only the new state list,
without refreshing the page at all. The state list would be
updated virtually instantaneously. The second option, using
Ajax, is the obvious choice.
Chances are you have already used the Ajax methodology. Many
web applications have been using this methodology for years.
The Google Local™ mapping application is a great example of
an entire web application based off this technology. While
clicking and dragging the map across the screen, new
sections of the map appear. Those new map images are
retrieved from one of Google’s web servers as needed, using
the Ajax methodology. Insala applications also use these
technologies to deliver complex functionality in a very
efficient way. Insala’s Resume Builder, Whiteboard and
Content Manager Application, to name a few, were all built
utilizing Ajax.
The boundaries of Ajax aren’t even visible at this point. We
are witnessing the beginning of a wave of web applications
that will employ this powerful technology. As the boundless
imaginations of web architects stretch into new areas, the
internet will slowly take on a different form. The
limitations of traditional web browsing are being cast
aside. Web applications will no longer focus on single page
requests. They will act as powerful engines that provide
smooth, quick browsing experiences never before seen in
internet computing and further strengthen the viability of
web-delivered software as a replacement for more traditional
models.
|
|
|
|