How to drive UX with AJAX

Default avatar.
July 15, 2015
How to drive UX with AJAX.
With mobile internet usage eclipsing desktop-based web browsing, it’s more important than ever for websites to be built with an emphasis on speedy page loads and fluid reactions to user input. One important technology we use to achieve this is AJAX, short for “Asynchronous JavaScript & XML.” AJAX allows you to update parts of a single webpage without continually throwing out the DOM (the HTML architecture of the page) — eliminating the need for entire page loads and creating a faster response to user input. Building websites on a 100% AJAX framework is a technique that reveals new possibilities as to what is attainable in web development. We began building sites as 100% AJAX nearly ten years ago and have since learned a lot about how to effectively employ it so that it improves user experience. In this article we’ll explore a number of the specific advantages, and some limitations, of this technique.

Fast user response

A key element of an effective UX is a speedy response to user input, but with a standard website, users are left waiting for interactions to take place as requests are placed over HTTP (or HTTPS) to the server, resulting in a complete page load for every change. This process occurs with every mouse click to request a new page, larger image, or more information; the DOM is completely thrown out and reloaded into your browser — this is often a wasteful process when loading pages on the same site, since they typically have similar content. kayak Kayak’s search is powered by AJAX, providing suggestions as soon as you begin typing. One major advantage of AJAX is its steady stream of information, unobstructed by the loading and unloading of the DOM, resulting in better control over the experience and a visitor’s attention. With AJAX, web applications can send data to and from the server asynchronously without interfering with the display of the existing page. The key difference between a standard AJAX implementation and a 100% AJAX-built website is that in the latter the basic DOM is loaded on the initial visit to the site, usually on the home page; everything else that occurs is simply a manipulation of that primary load. A prominent example of the fluidity afforded by AJAX is Google Maps. As you zoom in, out, navigate through a city in bird’s eye view or in street view, information is being seamlessly and continually delivered for your immediate use. When transitioning between pages or updating content in a web app, AJAX allows for user input to be responded to in a contextually appropriate manner, such as form output updated in real time without reloading the page, contextual animations transitioning between pages or when loading a detail view. google_maps When designing pages with a large amount of content, we employ AJAX’s infinite scrolling pattern, which not only saves browser bandwidth by only showing the information immediately relevant to the UX, but also reduces user friction. On our own company’s news page for example, more articles load as you scroll down, eliminating the use of pages and instead loading more information onto the screen as the reader requires it. This frictionless process of loading and unloading more content on-demand allows our visitors to get exactly as much news as they want without presenting barriers to their intent.

Seamless UX

Gaining control over how a website loads content creates a unique opportunity to design page transitions, loading animations, and visual cues that help the user understand the site’s hierarchy. This is also an opportunity for creativity with the company’s branding. A website with a 100% AJAX framework (because there is no full page load) does not provide feedback about its progress loading in the browser window, leading to potential confusion if a visitor is left waiting for an extended period of time with no response. This is where custom loading status indicators come into play, providing some indication that progress is being made during wait time. estesparkmedical Estes Park Medical Center in Colorado uses a personalized AJAX loader to maintain the coloring and brand of their organization as well as imparting the functionality of a loading symbol. zillow On the Zillow website, listings details are constantly updated without the use of the browser’s refresh button, giving home renters access to up-to-date information at all times. Small additions such as these are poignant in creating a memorable experience for your visitors and are made possible by the use of AJAX.

Taking control over the URL path using HTML5 history

Without individual page loads, a site is defined by having a single URL, causing problems on poorly built AJAX sites as users attempt to bookmark, or navigate using their browser’s forward and backward buttons. In addition, because Google’s search engine crawler historically did not read JavaScript, there have been concerns about how well AJAX-powered sites could be retrieved in Google’s organic search results. Both of these conditions are solved by gaining control over the URL path using the HTML5 history API. Each page of a 100% AJAX site and its alternate views are considered their own request; as you navigate through an AJAX site — even though it is technically a single page load — the URL in the browser updates to provide a unique address representing the current viewing state. In addition, we can listen for history change events in order to support the browser’s back button and return the previous viewing state. Each of these unique URLs are fully indexed by Google, meaning that this approach is fully compatible and helpful for SEO. a9 Amazon’s A9 search service depends on AJAX to retrieve substantial volumes of data without losing the user’s search history.

In conclusion

As you can see, AJAX is integral to the advancement of modern web development and supplants a number of inferior technologies that provided a poor user experience. Without AJAX, all page content had to be fully reloaded for almost every single user interaction, even if only some of the information had changed. This hindered speed, placed additional load on the server and used excessive bandwidth. By building on a 100% AJAX framework, we are able to create sites that are customized to the needs of clients, provide accessible navigation that can be bookmarked by site visitors, and that function on a much higher level. Featured image, data stream image via Shutterstock.

Mira Brody

Mira Brody is a copywriter and editor at Montana web design firm JTech Communications, where she's a member of the custom web development team providing technical writing and creating brand personas for a diverse array of clients.

Read Next

3 Essential Design Trends, December 2023

While we love the holidays, too much of a seasonal theme can get overwhelming. Thankfully, these design trends strike a…

10 Easy Ways to Make Money as a Web Designer

When you’re a web designer, the logical way to make money is designing websites; you can apply for a job at an agency,…

The 10 Most Hated Fonts of All Time

Remember when Comic Sans wasn’t the butt of the jokes? Long for the days when we actually enjoyed using the Impact…

15 Best New Fonts, November 2023

2023 is almost over, and the new fonts are still coming thick and fast. This month, we’ve found some awesome variable…

Old School Web Techniques Best Forgotten

When the web first entered the public consciousness back in the 90s, it was primarily text-based with minimal design…

20 Best New Websites, November 2023

As the nights draw in for the Northern hemisphere, what better way to brighten your day than by soaking up some design…

30 Amazing Chrome Extensions for Designers and Developers

Searching for a tool to make cross-platform design a breeze? Desperate for an extension that helps you figure out the…

Exciting New Tools for Designers, November 2023

We’ve got a mix of handy image helpers, useful design assets, and clever productivity tools, amongst other treats. Some…

The Dangers of Doomscrolling for Designers and How to Break Free

As a creative professional, navigating the digital realm is second nature to you. It’s normal to follow an endless…

From Image Adjustments to AI: Photoshop Through the Years

Remember when Merriam-Webster added Photoshop to the dictionary back in 2008? Want to learn how AI is changing design…

3 Essential Design Trends, November 2023

In the season of giving thanks, we often think of comfort and tradition. These are common themes with each of our three…

30 Obsolete Technologies that will Perplex Post-2000s Kids

Remember the screech of dial-up internet? Hold fond memories of arcade machines? In this list, we’re condensing down 30…