要提取URL的主机名部分,请使用主机名方法
<!DOCTYPE html> <html> <body> <script> var url = new URL("http://example.com/asdf/asdf/sadf.aspx?blah"); document.write(url.hostname); </script> </body> </html>
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分