Blog Post RSS ?

Blogs » JavaScript & CSS » Bookmarks and back button history for AJAX apps
 

Bookmarks and back button history for AJAX apps

by Kevin Yank

Aside from the accessibility concerns, which are indeed serious, the biggest problem with single-page AJAX applications (Web apps that work largely or entirely within a single page, like GMail) is that the standard navigation tools provided by Web browsers — bookmarks/favourites and the Back/Forward buttons — become totally useless.

Now, from the same clever monkey developing the AMASS client-side data storage system I mentioned previously, comes a very promising partial solution to these issues.

Really Simple History is a script that lets you associate page anchor names with application states (e.g. page.html#state). The script works by linking the user to a new anchor whenever the application enters a new state (e.g. editing a blog entry). The script then watches the current URL for changes to the current anchor (due to back/forward navigation), and triggers a function you specify so that you can update the application state accordingly.

Obviously it’s not quite as simple as I make out, but with the library in place, the code you need to write to support this is actually surprisingly simple. For now, Safari isn’t supported, but looking at how it works, I wouldn’t be surprised to see that browser supported before long.

The script’s site shows all the sample code you’ll need to get started if you’re a JavaScript gun. Less seasoned developers will want to check out the script author’s article on the O’Reilly Network.

Hopefully the large AJAX Web applications like GMail will lead the way by adding this to their offerings quick-smart. Now that proper bookmarking and navigation is now possible within single-page AJAX apps, I wouldn’t object quite as strongly to the notion of developing my next Web application ths way.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Ping.fm
  • Twitthis

Related posts:

  1. Are You Violating the Eolas Ajax Patent? It's true: Eolas has an Ajax patent and is filing...
  2. 10,000 iPhone Apps – How Many Are Good? There are now 10,000 applications on the iPhone App Store,...
  3. 4 Unique Apps for Tracking Time Keeping track of your billable hours is an essential task...
  4. The Blackletter Typeface: A Long And Colored History Jennifer takes a look at the Blackletter typeface which has...
  5. Who’s Using ARIA? In this post, James discusses the concept of Accessible Rich...

This post has 26 responses so far

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Follow SitePoint on...