Facebook应用(iframed)和浏览器返回按钮 [英] Facebook app (iframed) and browser back button

查看:115
本文介绍了Facebook应用(iframed)和浏览器返回按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用iframe的多页面Facebook应用程序。有没有办法使浏览器返回按钮的行为正确与此设置?目前,当您点击后退按钮时,您将返回画布页面,即使您已经在应用程序中导航了几​​页。



谢谢!

解决方案

简单的答案是否,你不能。



这是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆