콘텐츠로 건너뛰기

IE7에서는 window.open하면 return null 이다.

IE7을 사용하는데, 자바스크립트 오류가 발생한다는 고객문의를 받았다.

다른 분이 디버깅을 해주셔서 오류 부분을 확인해봤더니, 그리 복잡한 로직은 아니다.

oWin에 focus() 함수가 없던지, 혹은 oWin이 없던지가 문제이다.

개발자는 NPE를 싫어하니까, oWin이 없을 거라 먼저 생각하고 접근했다.

MSDN을 보니, IE7에서는 window.open 함수를 쓰면 return이 null값이 온다고 한다.

internet Explorer 7 on Windows Vista. Opening a new window from an application other than the Internet Explorer process may result in a NULL return value. This occurs because Internet Explorer runs in protected mode by default. Protected mode prevents applications from privileged access to Internet Explorer when that access spans process boundaries. Because this method opens windows in a new process, protected mode restricts access to the new window. For more information, please see Understanding and Working in Protected Mode Internet Explorer.

결국엔 아래처럼 수정했다.

관련링크 : http://msdn.microsoft.com/en-us/library/ms536651%28VS.85%29.aspx

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다