- IE9(win7), IE11(win7, win10)、Edgeで発生を確認。
- chrome, firefox, safari(IOS9.3.2), IE6(xp), IE8(win7) では問題なし。
- apacheは2.2系。
- 同じような現象に遭遇した人用に残しておく。
IEの設定かも(?)
現象
iframe内のlocation.reload();
を実行すると
iframeだけがブラウザに表示される (ブラウザのURLはiframeのsrc)
という現象に遭遇。
なおこの現象は<a href="http://xxx.com/a.html">reload</a>
と書けばフレーム内でリロード問題なかった。
ソース
index.html
aaa
<iframe src="http://xxx.com/a.html"></iframe>
aaa
a.html
<input type='button' onclick='location.reload();' value='reload' />
組み合わせ
- urlはぼかしています。htmlファイル名は何でも良いです。
- 発生するサーバ内で完結すると発生しない。
- 発生するサーバがからむと発生する。
- 発生しないサーバ同士だと発生しない。
パターン | 有無 |
---|---|
http://xxx.com/index.html で iframe src="http://xxx.com/a.html" の時 | 現象は起きない |
http://xxx.com/index.html で iframe src="http://hoge.com/a.html" の時 | 発生 |
http://hoge.com/index.html で iframe src="http://xxx.com/a.html" の時 | 発生 |
http://fuga.com/index.html で iframe src="http://xxx.com/a.html" の時 | 現象は起きない |
http://xxx.com/index.html で iframe src="http://fuga.com/a.html" の時 | 現象は起きない |