Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
3 つの iframe A、B、C に分割された単純な Web ページがあります。
iframe B は Ajax リクエストを実行し、ページを更新してログイン ページにリダイレクトする必要があります。明らかに、ログイン ページは iframe B 内でのみ発生します。ページ全体をリダイレクトする方法はありますか?
top.location の簡単なチェックは機能しませんか?
<script type="text/javascript"> <!-- if (top.location!= self.location) { top.location = self.location.href } //--> </script>
これはうまくいくはずです。
<script> Window.top.location = 'new url'; </script>