欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

html頁面中怎么獲取項目根目錄

江奕云2年前19瀏覽0評論

html頁面中怎么獲取項目根目錄?

css的引入方法:

。/js獲取項目根路徑,如: http://localhost:8080/ems

getRootPath:function () {

//獲取當前網址,如: http://localhost:8080/ems/Pages/Basic/Person.jsp

var curWwwPath = window.document.location.href;

//獲取主機地址之后的目錄,如: /ems/Pages/Basic/Person.jsp

var pathName = window.document.location.pathname;

var pos = curWwwPath.indexOf(pathName);

//獲取主機地址,如: http://localhost:8080

var localhostPath = curWwwPath.substring(0, pos);

//獲取帶"/"的項目名,如:/ems

var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);

return(localhostPath + projectName);

css樣式引用,html頁面中怎么獲取項目根目錄