Asistentes Virtuales - e24Presenter

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

9 Respuestas para “History Manager para AJAX, solución al botón back”

  1. webeame.net Dice:

    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….

  2. Cristi Dice:

    Hi,
    a little help or some documentation will be useful

    Thanks

  3. aartiles Dice:

    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.

  4. greg Dice:

    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.

  5. Rocco Dice:

    Is there already a quick-and-dirty example?

    I will really appreciate …

  6. aartiles Dice:

    Hi greg, thanks for your tips, i will fix it very soon

  7. aartiles Dice:

    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/

  8. Matt G Dice:

    ‘writeAttribute’ is the Prototype method, not ’setAttribute’: http://prototypejs.org/api/element#method-writeattribute

  9. greg Dice:

    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.

Dejar un Comentario