[
https://issues.apache.org/jira/browse/TAP5-1193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014308#comment-13014308
]
Howard M. Lewis Ship commented on TAP5-1193:
--------------------------------------------
A challenge; that code was place there for a reason ... I can't remember the
exact details, but it was a flash of spurious errors when page navigation and
Ajax responses got into some kind of race condition.
> tapestry.js prevents using the back/forward browser cache
> ---------------------------------------------------------
>
> Key: TAP5-1193
> URL: https://issues.apache.org/jira/browse/TAP5-1193
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.1.0.4
> Reporter: Dan Adams
>
> At the bottom of tapestry.js is the following:
> // Ajax code needs to know to do nothing after the window is unloaded.
> Event.observe(window, "beforeunload", function()
> {
> Tapestry.windowUnloaded = true;
> });
> Assume you have a page that does this:
> - loads in some initial state
> - user does something causing a ajax request that changes the DOM
> - user clicks a link to go to another page
> - user clicks back button
> rather than getting the state of the page before they left the user will get
> the original state of the page including the DOM and js state and the load
> handlers will be run. Using the hash method of maintaining ajax history (or
> maybe a cookie) is really not an option in this case because the DOM is out
> of date. You'd need to do an extra ajax request to the server to restore the
> state and the user experience would be really poor.
> There needs to be at least of the option of disabling this for pages that
> need this behavior.
> See
> http://stackoverflow.com/questions/158319/cross-browser-onload-event-and-the-back-button
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira