发布时间:2021-06-29编辑:佚名阅读(2169)
const myURL = new URL('https://www.a.com:8888/b.html?c=1#d'); console.log(myURL);
输出
URL { href: 'https://www.a.com:8888/b.html?c=1#d', origin: 'https://www.a.com:8888', protocol: 'https:', username: '', password: '', host: 'www.a.com:8888', hostname: 'www.a.com', port: '8888', pathname: '/b.html', search: '?c=1', searchParams: URLSearchParams { 'c' => '1' }, hash: '#d' }
2人
1人
1人
0人