js 中用 location.pathname 获取项目名

来源:互联网 发布:网络信息安全管理办法 编辑:程序博客网 时间:2024/06/05 03:21

var getContextPath="/"+location.pathname.split("/")[1];$.ajax({url : getContextPath+"/exchangeRate/selectByCode.shtml",type : "post",data: {code: $('#code').val()},async : false,dataType:'json',success : function(data) {if(data != null){valid = false;}}});


0 0
原创粉丝点击