js获取项目路径

var location=(window.location+'').split("/");
var basePath=location[0]+'//'+location[2]+'/'+location[3];
var purl=basePath+'/match/matchData';

原文地址:https://www.cnblogs.com/lengzhijun/p/5605088.html