2012-11-14 4 views

답변

5

은 하나 개의 가능한 솔루션입니다

광고에서 마지막 부분까지 /까지 하위 부분을 추출하려면 다음 스크립트를 사용할 수 있습니다.

<script type="text/javascript"> 
var currUrl = window.location.href; 
var modUrl =currUrl.substring(0,currUrl.lastIndexOf("/")); 
//modUrl =currUrl.substring(0,currUrl.lastIndexOf("bbb")); //Incase you have some other criteria to extract the sub URL. 
</script> 

희망이 있습니다.

-2

는 현재 창 URL을 얻으려면 당신이 사용할 수 있습니다 window.location.href;

다음
관련 문제