獲取項目整體URL前綴的方法,用於與後臺通信

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";

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章