js获取服务端IP、端口、协议

  1. alert("location:"+window.location);
  2. alert("href: "+window.location.href);
  3. alert("protocol: "+window.location.protocol);
  4. alert("host&port: "+window.location.host);
  5. alert("port: "+window.location.port);
  6. alert("hostname: "+window.location.hostname)

猜你喜欢

转载自blog.csdn.net/yulei2008_/article/details/108056855
今日推荐