js 獲取當前web應用的上下文路徑實現方法
//js webcontext
var webroot=document.location.href;
webroot=webroot.substring(webroot.indexOf('//')+2,webroot.length);
webroot=webroot.substring(webroot.indexOf('/')+1,webroot.length);
webroot=webroot.substring(0,webroot.indexOf('/'));
rootpath="/"+webroot;
以上這篇js 獲取當前web應用的上下文路徑實現方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持。