History Manager para AJAX, solución al botón back
Una de las mayores críticas a las aplicaciones web en AJAX es acerca de sus limitaciones de accesibilidad y usabilidad. Los usuarios tienen ya vicios y costumbres y no entiende de AJAX, ello solo quieren que si le dan al botón back funcione como siempre y valla a la página anterior, y que si marcan una página en sus favoritos que luego cuando vuelva valla a la pantalla que el marcó y no a la página principal que es lo que suele suceder con las páginas web en AJAX.
Digitarald.de ha desarrollado una solución HistoryManager - The Ajax Back-Button (v1.0) para aquellos que usan Mootools Pueden probar sus ejemplos, y por mi parte yo lo he implementado en www.equipo24.com
Como también suelo desarrollar con Prototype he reescrito el código para que sea compatible con dicha librería, la forma de uso es muy similar al original. Espero que os sea útil.
Descargar prototype.historyManager.js










5 de Julio, 2008 a las 6:21 pm
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….
10 de Julio, 2008 a las 4:53 pm
Hi,
a little help or some documentation will be useful
Thanks
10 de Julio, 2008 a las 5:16 pm
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.
22 de Julio, 2008 a las 9:57 am
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.
23 de Julio, 2008 a las 5:05 pm
Is there already a quick-and-dirty example?
I will really appreciate …
2 de Agosto, 2008 a las 8:42 pm
Hi greg, thanks for your tips, i will fix it very soon
2 de Agosto, 2008 a las 8:44 pm
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/
3 de Agosto, 2008 a las 5:20 pm
‘writeAttribute’ is the Prototype method, not ’setAttribute’: http://prototypejs.org/api/element#method-writeattribute
27 de Agosto, 2008 a las 5:02 pm
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.