码迷,mamicode.com
首页 > Web开发 > 详细

jquery获取项目的路径

时间:2016-06-29 13:10:44      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

var getWebRootPath = function () {
var a = window.document.location.href;//
var b = window.document.location.pathname;
var pos = a.indexOf(b);
var path = a.substring(0, pos);
a = a.substring(a.indexOf("/") + 2, a.length);
a = a.substring(a.indexOf("/") + 1, a.length);
var pathName = a.substring(0, a.indexOf("/"));
return path + "/" + pathName;
}

jquery获取项目的路径

标签:

原文地址:http://www.cnblogs.com/lizuoqi/p/5626235.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!