DavidCramer / BaldrickJS

A Simple, Tiny Ajax Framework.
baldrickjs.caldera.co.za
MIT License
21 stars 5 forks source link

back and forward in a browser does not work consistently #4

Closed rjmcguire closed 11 years ago

rjmcguire commented 11 years ago

Follow a link that has a trigger which changes the pages content, then click back. If there is no longer a hash value in the address bar then the page will not go back to the state that the page was originally in before you clicked the link.

rjmcguire commented 11 years ago

This is easily fixed by refreshing the page when the hash in the url is cleared. However this causes all forward links to stop working because the ids on the trigger elements are no longer the same.

We need to generate consistent unique ids for elements. Or only register history on elements that have ids that were not generated by baldrick.

rjmcguire commented 11 years ago

history works now. only refreshing a page does not work. Not sure what we can do here. In the simplest case we can let the autoloads run and then run the hash if there is one. Firsts attempts at this were thwarted by httpxml requests still running. could do it if we could wait for all xmlhttp requests to complete.

commit for this is: a6bb7375d6353d9cf8ae0e839e910bba15035b9f