var getLocation = function(href) { var l = document.createElement("a"); l.href = href; return l;};var l = getLocation("http://example.com/path");console.debug(l.hostname)>> "example.com"console.debug(l.pathname)>> "/path"
欢迎分享,转载请注明来源:内存溢出
var getLocation = function(href) { var l = document.createElement("a"); l.href = href; return l;};var l = getLocation("http://example.com/path");console.debug(l.hostname)>> "example.com"console.debug(l.pathname)>> "/path"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)