LoginSignup
8
8

More than 5 years have passed since last update.

jQuery Mobileを利用したページでauth認証後のページが表示されないときの解決法

Last updated at Posted at 2012-09-06

railsのomniauth-facebookで、スマホWebページにfacebookログインを実装していたところ、jQuery Mobileが効かなくなって詰まったのでメモ。

原因

コールバックで返ってくるURLに、"#_=_"という余計なやつがくっついてくるのがどうやら原因らしい。jQuery Mobileがなぜか効かなくなる。

解決法

上記のURLの余計な部分をjavascriptで取り除く。

表示したいページのviewファイルに

hoge.html.erb
<script>
if (window.location.hash == "#_=_") window.location.hash = "";
</script>

を加える。これで解決した。

こちらを参考にした。
http://stackoverflow.com/questions/10539983/jquery-mobile-page-wont-load-after-facebook-authentication-in-chrome

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8