AJAX is great, but not always..

by Justin 4. February 2008 20:10

I've noticed that AJAX has the same affect on people as OOP. Once someone finally grasps the concept(s) they become so excited that they find a way to overuse the technology in a way that demonstrates its weaknesses.

A good example of poor AJAX use is flickr's camera finder feature. You choose a camera and it shows examples of pictures that were taken with the camera.

Video Demonstration: ajax_navigation_issue.wmv (1.47 mb)

  1. Change the "Now showing" drop down box from "interesting pictures" to "night photos."
  2. You'll notice what's obviously an AJAX update.
  3. Click one of the "night" photos.
  4. Now click the back button.
  5. Notice that you're shown the "interesting pictures" again, but the drop down list says "night photos"!

To view the night pictures again you must change the "Now showing" drop down list to something else, then change it back to "night photos" again. Then you'll actually see the "night photos" again. How annoying. I ended up working around this by opening each picture in a new Firefox tab, but how many web users know how to do this?

Someone else that I used to work with done something very similar after he first learned AJAX techniques. It was a gallery feature that had thousands of pictures and used pagination. I would skip through 30 pages looking at thumbnails until I found a picture I liked. Clicking on an image would take us to another page, showing the picture in its full size and giving some basic information about it.

However, when I clicked the back button I was no longer on page 30, but on page 1 again! Really, really annoying and very similar to the problem mentioned above. The ironic part was that the AJAX was updating around 80% of the HTML on the gallery page! I told him, politely, that a good old fashioned post-back would be the best solution here. He resisted because of the amount of work he already put into AJAX calls, and he even talked about fixing it with some incredibly complicated AJAX-based solution, but eventually he agreed with me and removed AJAX from the gallery altogether.

My point isn't that I don't like AJAX, but that AJAX is NOT the be-all-end-all of web development. It is NOT a solution to every problem, or even most of them. AJAX has the potential to lessen the strain on servers by reducing the amount of data needed to be transferred, and also to perform some pretty slick effects that were difficult several years ago, but you need to know when to use it. Before you ever take on an AJAX-based solution you need to make sure it will improve the user's experience, not make it worse. If you get nothing else from this entry, just remember to always be careful when mixing AJAX with navigation.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Justin HoltonHi, my  name is Justin. I cut my teeth learning HTML back when Netscape Navigator was still the most popular web browser. Later that inspired me to major in Computer Science at college. Today I'm a professional web developer with experience in everything from social networking application design to Search Engine Optimization (SEO). I believe the Internet is the most important achievement of man since the printing press, and I'm grateful that I was born in time to see it go from obscurity to a ubiquity.

Page List