So contrary to my last post, it does work in Internet Explorer. I had accidentally overwritten their blank.html file with the one used by YUI. This file is required for the IE IFRAME and contains a callback to
window.parent (the browser window that you are using dhtmlHistory in). If the following is missing, then IE won
I never did manage to get it working in Safari 2 or 3, so if anyone knows of a back history method that works in Safari, please leave a comment.
I have two working demos now, one uses the files provided and the other uses my cleaned up YUI version.
What is the difference?
My version uses my favorite pattern (Module) instead of the Prototype Pattern, which reduces confusion and truly makes functions and variables private. I use compliant DOM method,
document.createElement(), instead of
document.write. This also eliminates the need to use
document.getElementById(). Also, as long as you wait for the DOM to be ready, leveraging
YAHOO.util.Event.onDOMReady(), you do not need the
window.dhtmlHistory.create(), as everything can be done in your initialization method. Lastly, because we are leveraging YUI, I demonstrated the unobtrusive way to do this demo. You could also remove the JSON Object and replace it with something simpler that meets your needs and that will save you another 5k.