Friday, September 14th, 2007

How to build a cross-browser history management system

Category: Browsers, JavaScript

History management comes up often, and Bertrand Le Roy of Microsoft has written about his experience building a cross-browser history management system.

Betrand details his foray into dealing with browser quirks of IE, Safari, and Opera:

So things are in a pretty grim state currently. It seems like we’re going back (pun intended). We used to have a collection of tricks that made possible an implementation of a history manager that worked pretty well in IE, Firefox, Opera and Safari. Now, we only have IE, Firefox and Safari Mac. I just hope this is only temporary and that both Apple and Opera repair their browsers soon.

Cross Browser History

Posted by Dion Almaer at 5:44 am

3.5 rating from 32 votes


Comments feed TrackBack URI


Why not use YAHOO history?

On my site it works perfectly in all of the browsers:

Comment by ziutek — September 14, 2007

“I just hope this is only temporary and that both Apple and Opera repair their browsers soon.”

Does anyone else appreciate that quote from a Microsoft employee?

Comment by Zach Leatherman — September 14, 2007

Folks using the Yahoo! history library may also be interested in this article:

Comment by Julien Lecomte — September 14, 2007

Do you want to say with your post that it is ok for everyone to bitch about MS bugs, but if someone at MS points out bugs in other systems that they have to shut up about it?
Why don’t you just go ahead and blame Bertrand Le Roy for every bug that MS has produced?

Comment by Andre — September 14, 2007

It’s probably a tongue-in-cheek comment, Zach, Andre, he can only hope for any fixes from Apple and Opera; With IE’s serious history entry problems he (and we) know there’s no hope!

Comment by Charles — September 14, 2007

Hey, if history management is so innate in all browsers, why, since the advent of dom manipulation and ajax has the browser industry not introduced some sort of standard?

I’ve been hearing about getting your application to have a history stack for over a year now (I think 2). I would enjoy it if every change we made, we could just register it into a unique event id (so that multiple changes can be made and related to the same “state/event” in the history stack) as well as a method to invert that change. If each browser had a standard object window.record, then we could register actions and their inverse action. To start a new event, we’d just say new window.record.startNewEvent(); and then to access that you could just call window.record.addSubEvent(methodToUndo,args). args could contain other methods that must be called prior to this being inverted.

Heck, I don’t know, just trying to be creative, but I wish that browser developers would address this issue with a standard approach. :(

P.S. I know most of you didn’t like that comment about an MS developer wishing other browser vendors to fix their bugs, but I gotta say, I laughed out loud when I saw that… I was like – That’s so ironic

Not that he owns the bugs for MS, but shows the way that (as I’ve heard in church) “Why do you point out the spec in others’ eyes when there is a log in yours” :)

Comment by Chad — September 14, 2007

Firefox beet them all, so this is the reason I use this great web browser

Comment by Web 2.0 Reviews — September 15, 2007

I just found humor in the wording, especially the use of “soon,” given the amazing turnaround time for all the bugs I’ve submitted to the Internet Explorer bug tracker.

Comment by Zach Leatherman — September 15, 2007

Leave a comment

You must be logged in to post a comment.