Facebook应用(iframed)和浏览器返回按钮 [英] Facebook app (iframed) and browser back button
问题描述
谢谢!
简单的答案是否,你不能。
这是IFRAME的问题年龄,并使许多网站开发人员感到沮丧。
后退按钮是一个HORRIBLE按钮,IMHO应该从浏览器世界中删除,但是由于我不久以后就会看到这些事情,这里是你可以做的。
您可以做的最好的事情是使用JavaScript来捕获事件,当浏览器尝试从当前顶级页面导航时。从那里你可以给用户一个对话,询问他们是否真的要离开页面。
I have a multipage Facebook app using iframe. Is there a way to make the browser back button behave properly with this setup? Currently when hitting the back button you are returning to the canvas page, even if you have navigated several pages down the app.
Thanks!
The simple answer is No, you can not.
This has been the problem with IFRAME for ages, and has frustrated many a web developer. The Back button is a HORRIBLE button, and IMHO should be removed from the browser world, however since I dont see that happening any time soon, here is something you can do.
The "best" thing you can do is use javascript to catch the event for when the browser tries to navigate away from the current top level page. From there you cna give the user a dialog asking them if they really want to leave the page or not.
这篇关于Facebook应用(iframed)和浏览器返回按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!