Recent Weblogs

Links I like

Ajax history, Stateful Applications

The biggest problem with Ajax applications is saving state and accomodating the familiar progression of the history controls (Back/forward buttons). Ajax allows the document to become stateful, but when the user instinctively goes for the history controls in the browser window, things go wrong. The user expecting to see the previous state of the document is suprised to see a webpage they were on 20 minutes ago, before they arrived on your application.

Theories and the like

This problem has been addressed by many developers including myself.

  • DHTML Nirvana an interesting approach using IFRAMES, it had some shortcomings for me in FF 2.0 but a good effort at the problem.
  • Brad Nuremburg describes a method using window.location, a polling interval and a structured HashMap object.
  • Aaron Swartz talks about the issue, wasn't able to find his implementation or a demo of his approach in action.
  • Ajax.Service.History my prototypejs extension to handle the history controls.
  • Method for saving state my approach for handling state restoration in ajax applications.

The Clash of Coupling

As you can see above I have an article addressing each fundamental issue with the overall problem with "ajax history". The problem still exists because I cannot combine these methods. When using the IFRAME approach the user can't quickly say "Bookmark this Page" as the URL of the window hasn't changed. Modifying the URL will ruin the IFRAME approach for Gecko browsers as it registers as a new page in the history array. Strictly modifying the window.location has two disadvantages, one it requires polling as there is no proper DOM event to capture this. Two it won't work in IE and despite my passionate hatred for the browser I still work to accomodate those users.

An Interface to Accomodate

Although the most convienent and ideal interface isn't quite achievable I believe the "fail over" is still sufficient. The idea is very similar to Google Maps, maintain history privately but allow a control for the user to easily access the URL to rebuild the current state. The control being a "Bookmark Link", a link placed prominently on the page that contains the URL information for state restoration.

Straight to the Implementation

I could profess this idea a lot more but writing English to describe Javascript is a situation begging for plenty to be lost in translation. Please visit my project site to see a demonstration of this technique. It is a page showing off a very simple technique for updating content from a navigation component.

Conclusion

Comments

September 18, 2008Computer driver download site

Thanks

September 27, 2008Games

Thanks

November 06, 2008watch

thanks yourss

December 22, 2008Gazeteler

Good post thanks for sharing.

January 24, 2009Web Design Leicester

JavaScript benchmarks have achieved greater visibility in the Ajax era, but they have a long and proud history. I did a little digging and came up with this round-up of profiling suites past, present and future. Many of them mix pure JS tests with DOM tests. Those that focus more on a specific type of operation are broken out into a separate list after the jump, as are browser-specific benchmarks and a bunch of cobweb-covered older suites.

January 28, 2009tony

It toke me a couple of days to understand your approach to the problem, and after the successful implementation of your solution, I am inclined to agree with everyone else that says YOU'RE A GENIUS, thank you so much for sharing this information.
You truly deserve all of my best wishes.

May 06, 2009delta9

i love the way he does on Itbreaks, but i don't know if it works on IE6..
See it http://www.itbreaks.com

Name
Site
Comment
  CAPTCHA Image
Reload Captcha Image
Captcha