var stargis={};
stargis.platName = "Platform";//項目名
stargis.webServicePath = window.location.href.substring(0, window.location.href.indexOf(stargis.platName))+stargis.platName;
至此得到類似http://.....的格式,之後加上 controller中的路徑就可以對應使用後臺方法
例如
abc = stargis.webServicePath + "/public/log/insert";