js 判断传入参数是域名还是地址
var get = function(url) {
if(location.protocol === "http") {
return url;
}
var reg = /^(http[s]?:\/\/)?([^\/]+)(.*)/,
matches = url.match(reg);
url = list.hasOwnProperty(matches[2])&&(list[matches[2]] + matches[3]) || url;
return url;
}