![javascript获取host javascript获取host](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
document.writeln(location.protocol);
document.writeln(location.origin); //包括端口号
document.writeln(location.host); //不包括端口号
document.writeln(location.port);
//默认为80的就为空
document.writeln(location.pathname);
<a href="<%=location.origin%>/membership/member/detail?member_id=<%= item.member_id %>">