function getContextPath01() {
var ctxPath = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2));
alert("<%= request.getContextPath()%>:"+ctxPath);
return ctxPath;
}
===================================================================================================
http://megatechnics.tistory.com/entry/%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EC%97%90%EC%84%9C-ContextPath-%EA%B5%AC%ED%95%98%EA%B8%B0-javascript
function getContextPath(){
var offset=location.href.indexOf(location.host)+location.host.length;
var ctxPath=location.href.substring(offset,location.href.indexOf('/',offset+1));
alert("<%= request.getContextPath()%>"+ctxPath);
return ctxPath;
}
'javaScript' 카테고리의 다른 글
button 태그에서 onClick의 스크립트가 동작하지 않을때 (0) | 2015.11.23 |
---|---|
[jquery] jquery.blockUI를 이용한 모달창 띄우기 (0) | 2015.10.23 |
href="#"... 페이지 변화 없에는 법 (0) | 2015.09.30 |
[jquery] jquery 콤보박스 멀티선택 (0) | 2015.09.24 |
[jquery] jquery 접근하기, 날짜 계산 (0) | 2014.02.12 |