개인적인 프로그램/자바스크립트
javascript에서 with <<< 요놈
삽지리
2011. 10. 26. 13:36
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
위와같은 페이지에 보면 with가 쓰이는데..
이건 with(navigator){
이안에 들어있는 appName는 appName가 아니라
navigator.appName << 요놈이 호출되는것
}