开发者

Is it possible to capture browser back button press

开发者 https://www.devze.com 2023-02-22 01:49 出处:网络
I am updating the page via render :update do |page| page.replace_html \'intainer\', :partial => \'users/partial/trest\'

I am updating the page via

render :update do |page|
  page.replace_html 'intainer', :partial => 'users/partial/trest'
end

So, when a user presses back, they (apparently) get taken back two pages. I would like to continue to use 开发者_JS百科the page.replace, however, I would like to know if there is a way to capture the back button press and call another page.replace to effectively change the page back to its previous state instead.

I suppose the alternative is to put a 'back' button, but that is less desirable.


Well i don't know ruby, but back button is browser stuff and ruby is server side language. You need to work with javascript here to do that.

0

精彩评论

暂无评论...
验证码 换一张
取 消