자바스크립트 문의입니다. 정보
자바스크립트 문의입니다.
본문
self.close();
window.close();
이 두개가 먹히지 않는 이유가 멀까요?
즉 이 두개의 스크립트를 써도 이상하게 창이 닫기지 않습니다.
댓글 전체
페이지를 실제 봐야 할 것 같은데요.
현재 내용만으로는 이유를 알기가 어려워 보여요.
현재 내용만으로는 이유를 알기가 어려워 보여요.
<a href='javascript:self.close();'>닫 기</a>
<a href='javascript:window.close();'>닫 기</a>
이렇게 사용했는데 안된다는 말씀이신가요?
<a href='javascript:window.close();'>닫 기</a>
이렇게 사용했는데 안된다는 말씀이신가요?
이렇게 사용했습니다.
var width=screen.width;
var height=screen.height-50;
window.open('../index.html', '','width='+width+',height='+height+',location=yes,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,top=0,left=0');
self.close();
제가 구현할려는 것은 새창으로 페이지를 열고 자신은 닫게 하고 싶습니다.
var width=screen.width;
var height=screen.height-50;
window.open('../index.html', '','width='+width+',height='+height+',location=yes,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,top=0,left=0');
self.close();
제가 구현할려는 것은 새창으로 페이지를 열고 자신은 닫게 하고 싶습니다.
skin/member/basic/zip.skin.php
파일을 참고하세요...우편번호 검색 입력창에 같은 기능이 구현되어있네요...^^
파일을 참고하세요...우편번호 검색 입력창에 같은 기능이 구현되어있네요...^^
마우스로 닫기 를 클릭하지 않고 그냥 창이 닫겨야 합니다.
오픈창을 열어준 부모창은 닫기를 위한 자바스크립트를 사용해도 닫을것인지를 물어보는
창이 뜨게 됩니다.
창이 뜨게 됩니다.
<script language='Javascript'>
function select_new() {
var width=screen.width;
var height=screen.height-50;
var new_win = window.open('../index.html', '','width='+width+',height='+height+',location=yes,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,top=0,left=0');
window.close();
return false;
}
</script>
<a href='javascript:;' onclick="select_new();">새창은열고 현재창은 닫기</a>
이렇게 해보세요.......^^
function select_new() {
var width=screen.width;
var height=screen.height-50;
var new_win = window.open('../index.html', '','width='+width+',height='+height+',location=yes,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes,top=0,left=0');
window.close();
return false;
}
</script>
<a href='javascript:;' onclick="select_new();">새창은열고 현재창은 닫기</a>
이렇게 해보세요.......^^
오픈된 창에서 onload시 opener.close() 해도 될듯 ^^