Facebook Omniauth登录后如何从URl中删除丑陋的字符

时间:2013-03-12 09:49:23

标签: ruby-on-rails facebook

我正在使用omniauth-facebook gem,效果很好。

但是当它在应用程序上加载页面时,会将这些字符添加到url:

/#_=_

如何阻止这种情况发生。

NOOB

2 个答案:

答案 0 :(得分:0)

试试这个:

<script type="text/javascript">
            if (window.location.hash == '#_=_')window.location.hash = ''; //this script removes the #_=_ from the url which is appended by facebook after login
</script>

答案 1 :(得分:0)

试试这个:

<script type="text/javascript">
if(window.location.hash=="#_=_") window.location.href="http://yourdomain.com/";
</script>