问题
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#_=_
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.
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.
回答1:
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>
Theoretically the routine will be called before $(document).ready :) (never tried it on jquery mobile though)
来源:https://stackoverflow.com/questions/8069704/facebook-oauth-login-with-jquery-mobile