AJAX History Manager, back button fix
One of the major issues on AJAX web applications is the accesibility and usability lacks. Many users have manies and don¡t undestands about AJAX, they only expects that if they click the back button then it must works as always and get them back to the previous screen.
Digitarald.de have developed a solution HistoryManager - The Ajax Back-Button (v1.0) for Mootools developers. You can test some samples there and also I have implementerd it on my company web www.equipo24.com
But I also use to develop using Prototype so I have rewritten that library using Prototype, the usage is very similar to the original library.
Download prototype.historyManager.js
If you want to check what I am working on now, then follow me at twitter @aartiles24
Comentarios
You can find the api documentation on the original library’s page http://digitarald.de/project/history-manager/. It have the same interface, i just rewrote the code to let it work with Prototype.
Any way I am planing to post some good examples using prototype.
Hi,
I just want to highlight two problems in you script:
- In the register method, the MooTools’ function $merge returns a copy of the extended object
otherwise Object.extend does return the extended object itself, so if you register more than one object,
they will both use the same data object. You must clone the data object before extends it, like this:
var data = Object.extend(Object.clone(this.dataOptions), options || {});
- In the setState method, you try to call this.form.setProperty(), but this method doesn’t exist in Prototype, only in MooTools.
You must use setAttribute() instead of setProperty().
Thanks for the script, it’s really helpful.
Rocco you can see a case study at this post http://www.flash-free.org/en/2008/08/02/monperlaes-%e2%80%93-web-totalmente-ajax-desarrollada-con-prototype-y-scriptaculous/
‘writeAttribute’ is the Prototype method, not ’setAttribute’: http://prototypejs.org/api/element#method-writeattribute
Hi,
Yes Matt, you’re right, setAttribute is not a prototype method, but a javascript DOM object method.
I write the fix in a hurry, so I don’t search for prototype equivalent.
No es por ser pedante, pero es que daña a los ojos…. es vaYa no vaLLa.
Por lo demás, enhorabuena por la web, ojalá hubiesen más páginas web de esta temática para que la gente no hiciese tantas barbaridades con Flash…
Un saludo.
I have a very simple fix available. I detail it in my article here about a Simple AJAX Back Button Fix.
[...] Como se ha comentado en posts anteriores, las webs que para cargar una nueva página lo hacen mediante llamadas asincrónicas ajax sin necesidad de recargar la página presentan el problema de que si el usuario utiliza el botón Atrás (back) del navegador la página se abandonaría. Para solucionar esto hemos utilizado el componente protoHistoryManager. [...]
[...] Casi todos los frameworks AJAX suelen proveer soluciones, como el history manager de mootools o el history manager para prototype que desarrollé hace ya algún tiempo. Al usar estos componentes las URLs suelen quedar así: [...]





















Solución al problema del botón back en AJAX…
En AJAX24 nos proponen una solución al mítico problema con el botón back y los bookmarks que suelen presentar las aplicaciones web desarrolladas con ajax. Nos proponen dos solucuines para las librarías Mootools y Prototype….