BOM中的location对象方法整理
本站已不再更新,最新资源请前往zcjun.com获取!
location.href-- 返回或设置当前文档的URL location.search -- 返回URL中的查询字符串部分。例如 http://www.dreamdu.com/dreamdu.php?id=5&name=dreamdu 返回包括(?)后面的内容?id=5&name=dreamdu location.hash -- 返回URL#后面的内容,如果没有#,返回空 location.host -- 返回URL中的域名部分,例如www.dreamdu.com location.hostname -- 返回URL中的主域名部分,例如dreamdu.com location.pathname -- 返回URL的域名后的部分。例如 http://www.dreamdu.com/xhtml/ 返回/xhtml/ location.port -- 返回URL中的端口部分。例如 http://www.dreamdu.com:8080/xhtml/ 返回8080 location.protocol -- 返回URL中的协议部分。例如 http://www.dreamdu.com:8080/xhtml/ 返回(//)前面的内容http: location.assign -- 设置当前文档的URL location.replace() -- 设置当前文档的URL,并且在history对象的地址列表中移除这个URL location.replace(url); location.reload() -- 重载当前页面
版权声明:若无特殊注明,本文皆为《 子成君 》原创,转载请保留文章出处。 本文链接:BOM中的location对象方法整理 https://old.zcjun.com/learn/520.html 百度收录:本文已被百度收录点击查看详情!
本文到此结束
发表吐槽
你肿么看?
既然没有吐槽,那就赶紧抢沙发吧!