标签:
var Loc = function (host, path) {
this.host = host;
this.path = path;
this.getUrl();
};
Loc.prototype.getUrl = function () {
this.url = ‘http://‘ + this.host + ‘/‘ + this.path;
return this.url;
};
var createLoc = function (host, path) {
if (arguments.length === 1)
{
}
else {
return new Loc(host, path);
}
};
标签:
原文地址:http://www.cnblogs.com/yfann/p/4686561.html