location.href为获取当前页面的地址。
location.href="http://www.baidu.com"为当前页面跳转到http://www.baidu.com
location.protocol返回当前的协议,如:http:;
location.hostname返回当前的主机名,如:www.baidu.com
location.host返回当前的主机名以及端口如www.baidu.com:8080