Facebook的iframe应用程序 - 斯特兰奇重定向问题 [英] Facebook Iframe App - Strange Redirection Problems
本文介绍了Facebook的iframe应用程序 - 斯特兰奇重定向问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在一个Facebook应用程序的iframe做一个服务器端的重定向,我得到这个奇怪的Facebook商标的链接。当我点击它,我重定向到我的网站摆在首位的重定向设置。在这里会发生什么?在发生的任何点击保护?
When I'm doing a server-side redirection in a Facebook iframe application, I get the this strange Facebook Logo with a link. When I click it, I get redirected to site I set the redirection to in the first place. What happens here? Any "Click Protection" in place?
谢谢!
重定向code:结果
试图客户端重定向
Redirection Code:
Tried Client Redirect
args = dict(client_id=FACEBOOK_APP_ID, redirect_uri=base_dir , scope='user_photos,email,offline_access')
return render_to_response('fb/nopermission.html', { 'javascript': "<script>window.top.location=\"" + "https://graph.facebook.com/oauth/authorize?" + urllib.urlencode(args )+ "\"</script>" } )
和服务器重定向:
args = dict(client_id=FACEBOOK_APP_ID, redirect_uri=base_dir , scope='user_photos,email,offline_access')
return HttpResponseRedirect(https://graph.facebook.com/oauth/authorize?" + urllib.urlencode(args))
在这两种情况下相同的结果。
Same Result in both cases
推荐答案
有关重定向目的使用code:
For redirection purpose use this code:
<html><head>
<script type="text/javascript">
window.top.location.href = "<?php echo $loginUrl; ?>";
</script>
<noscript>
<meta http-equiv="refresh" content="0;url=<?php echo $loginUrl; ?>" />
<meta http-equiv="window-target" content="_top" />
</noscript>
这篇关于Facebook的iframe应用程序 - 斯特兰奇重定向问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文