Hello, I was just wondering what clever ways all the Ajax developers out there have come up with to add back button support to their web apps. I have seen a couple different ways on the net, but neither of them look very complete. Ideally, I would like a solution where I could modify Ajax.Updater to keep track of which pages where loaded into which elements, then create a function like Ajax.Back which would override the back button and figure out what should be loaded on the page. Is anyone planning on working on anything like this? If so, perhaps we could coordinate our efforts. Dillon Woods -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050813/7d25e329/attachment.html
On 13/08/05, Dillon Woods <dewoods@gmail.com> wrote:> then create a > function like Ajax.Back which would override the back button and figure out > what should be loaded on the page.You mean changing the action of the browser back button? You cannot do this, this is on the browser application level, no access to this from webpages. Any solution must add to window.history something that represents the application state. Bye, Martin
> > Any solution must add to window.history something that represents the > application state.Is it possible to add something to window.history? I played around with it for a while, and I couldn''t figure out a way to do it. I was thinking it might be possible to have a hidden iframe, and change it every time Ajax.Updater was called. That way, when the back button is pressed it would change the location of the hidden iframe, instead of the entire page. If we could then catch when the iframe is changed by the back button, we could use our back function to change the state of the application. Does this sound plausible? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050813/1523291c/attachment.html
The fellows over at Dojo have documented their experience with back-button support. If I remember correctly it seems plausible to hook on Firefox but you need some sort of timeout/iframe hack to work on IE, much like you''re describing. More info at: http://www.dojotoolkit.org/ or more specifically: http://dojotoolkit.org/svn/dojo/src/io/BrowserIO.js -San --- Dillon Woods <dewoods@gmail.com> wrote:> > > > Any solution must add to window.history something > that represents the > > application state. > > > Is it possible to add something to window.history? I > played around with it > for a while, and I couldn''t figure out a way to do > it. I was thinking it > might be possible to have a hidden iframe, and > change it every time > Ajax.Updater was called. That way, when the back > button is pressed it would > change the location of the hidden iframe, instead of > the entire page. If we > could then catch when the iframe is changed by the > back button, we could use > our back function to change the state of the > application. Does this sound > plausible? > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs>____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs