JQuery获取url信息

来源:互联网 发布:2016年网络端游排行榜 编辑:程序博客网 时间:2024/05/19 10:15
$(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#tab2$(location).attr('hash');                       #tab2$(location).attr('search');                     ?foo=123

来源: How to get Domain name from URL using jquery..?

0 0
原创粉丝点击