<script> <br>function getRootPath(){ <br> var strFullPath=window.document.location.href; <br>var strPath=window.document.location.pathname; <br>var pos=strFullPath.indexOf(strPath); var prePath=strFullPath.substring (0, pos); <br>var postPath=strPath.substring(0,strPath.substr(1).indexOf('/') 1) <br>return(prePath postPath) <br>} <br> var webpath= getRootPath(); //webpath는 디렉터리 경로 변수입니다. <br></script>