原生JavaScript技巧大收集100个
原生JavaScript获取域名主机 function getHost(url) { var host = "null"; if(typeof url == "undefined"|| null == url) { url = [removed].href; } var regex = /^\w+\:\/\/([^\/]*).*/; var match = url.match(regex); if(typeof match != "undefined" && null != match) { host = match[1]; } return host; } ............
下载地址
用户评论