使用 Jquery Mobile 登录 Facebook Oauth #_=_ [英] Facebook Oauth Login With Jquery Mobile #_=_
问题描述
当我尝试使用 Facebook Oauth 登录时,一切正常,直到 url 重定向部分如下:
When I try to login using Facebook Oauth all goes ok until the part the url redirects with something like this:
http://mywebsite.com/facebookoauthbackpage.php#_=_
我在我的页面上使用 jQuery Mobile,我认为 #= 是问题所在.
I'm using jQuery Mobile on my pages and I think that #= is the problem.
页面保持空白,没有任何反应.如果我删除#=",一切都会好起来的,动作会正常进行.
The page stays blank and nothing happens. If I remove the "#=" all goes alright and the action happens normally.
有没有人知道如何解决这个问题?我注意到从 Facebook 中删除#="将不再可能,所以也许从 jQuery 移动脚本中删除某些内容可能会用 javascript 解决这个问题,但我不知道如何这样做.
Does anyone have any idea on how to fix that? I've notice that removing the "#=" from the Facebook will not be possible anymore, so maybe removing something from the jQuery mobile script may solve that with javascript, but I don't know how to do that.
推荐答案
您可以尝试强行删除 html 开头的哈希,例如
You could try to forcefully remove the hash at the beginning of your html, something like
<script>
if (window.location.hash == "#_=_")
window.location.hash = "";
</script>
理论上该例程将在 $(document).ready :) 之前被调用(虽然从未在 jquery mobile 上尝试过)
Theoretically the routine will be called before $(document).ready :) (never tried it on jquery mobile though)
这篇关于使用 Jquery Mobile 登录 Facebook Oauth #_=_的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!