HTML

익스플로러8 iframe에서 로딩중 멈춤 현상

jeeyong 2015. 7. 6. 11:28

메인페이지내에 iframe이 존재하고, iframe내에서 다른 페이지로 이동할때 발생한 현상이다.


소스상의 문제는 전혀 없었고(iframe내의 페이지는 개발된 소스가 아니라 3rd party 솔루션) 


IE9~IE11까지는 아무런 이상이 없었는데, IE8에서만 상태표시줄에 파란색 Progress Bar가 사라지지 않고 화면이 멈춰버리는 현상이 발생했다. 그마저도 항상 그런게 아니라... 간헐적으로 프리징 현상이 발생함.


디버깅을 해보면, 화면이 로딩된후 XMLHttpRequest방식의 통신을 한뒤 응답없음 상태인걸로 확인.


결국 iframe내 소스에 아래 블로그에서 추천해준 javascript 문구를 심은뒤 그런 현상은 귀신같이 사라졌다.




IE Progress Bar Loading Forever for Iframe


IE’s progress bar sometimes makes it seem that the page is loading forever when you load a page in an iframe. The following is a workaround for it:


1. Create a blank.html file in the root web directory. This file need not contain anything.


2. Create an invisible iframe in your page by setting frameborder="0" and style="height: 0; width: 0"


3. After the Javascript code that loads the iframe, add the following line:


setTimeout("document.getElementById('ifrDummy').src = 'blank.html'", 100);


 - 참조 : http://www.rizalalmashoor.com/blog/ie-progress-bar-loading-forever-for-iframe/




실제 적용된 소스는 iframe에서 호출되는 jsp 하단에 아래와 같이 추가함.


1
2
3
4
5
<iframe id="ifrDummy" name="ifrDummy" frameborder="0" 
       style="height: 0; width: 0" src="../Empty.html"></iframe>
<script type="text/javascript">
setTimeout("document.getElementById('ifrDummy').src = '../Empty.html'", 100);
</script>

 

그리고 Empty.html에는 아무 내용도 들어있지 않다.


그러니까 익스플로러에 약간의 충격(?)을 주면 프리징 현상이 사라진다는 건데...

무슨 잠자는 숲속의 공주인가? 


정말 알다가도 모를 IE.....



출처 : http://regexr.tistory.com/24