欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript獲取web應(yīng)用根目錄的方法

 更新時間:2014年02月12日 11:05:55   作者:  
這篇文章主要介紹了javascript獲取web應(yīng)用根目錄的方法,需要的朋友可以參考下
復(fù)制代碼 代碼如下:

<script>
function getRootPath(){
var strFullPath=window.document.location.href;
var strPath=window.document.location.pathname;
var pos=strFullPath.indexOf(strPath);
var prePath=strFullPath.substring(0,pos);
var postPath=strPath.substring(0,strPath.substr(1).indexOf(‘/')+1);
return(prePath+postPath);
}
var webpath=getRootPath(); //webpath就是目錄路徑變量
</script>

相關(guān)文章

最新評論