$(location).attr(
'host'); www.test.
com:8082
$(location).attr(
'hostname'); www.test.com
$(location).attr(
'port');
8082
$(location).attr(
'protocol'); http
$(location).attr(
'pathname'); index.php
$(location).attr(
'href');
http:/
/www.test.com:8082/index.php
$(location).attr(
'hash');
$(location).attr(
'search'); ?foo=
123
来源: How to get Domain name from URL using jquery..?
转载请注明原文地址: https://www.6miu.com/read-29942.html