다음 코드 스 니펫을 사용하여 비대칭 방식으로 비동기 적으로 JavaScript를로드합니다. Chrome, FF에서는 작동하지만 Internet Explorer에서는 작동하지 않습니다.Internet Explorer에서 익명 함수가 작동하지 않습니다.
저는 IE8을 실행 중이며 아래 코드에 대해 IE에서 onload 기능을 사용할 수 없습니다.
<script type="text/javascript">
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'js/load_outer.js';
s.onload = function() {
alert("Loaded");
}
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
</script>
누구든지 실수를 식별 할 수 있도록 도와 주시겠습니까?
감사
당신은 나 "로드"이벤트를하지 않을 수 있습니다 때 스크립트로드 IE에서. – Pointy
다음은 관련 질문입니다. [http://stackoverflow.com/questions/4845762/onload-handler-for-script-tag-in-internet-explorer](http://stackoverflow.com/questions/4845762/onload- script-handler-for-internet-explorer 태그). – jabclab
@jakeclarkson 링크를 제공해 주셔서 감사합니다. 그러나 타사 라이브러리를 사용하지 말아야했습니다. – Jayesh