


























location 对象描述了与一个给定的 Window 对象关联的完整 URL
location 对象的每个属性都描述了 URL 的不同特性
通常情况下, 一个 URL 会有下面的格式
协议//主机:端口/路径名称#哈希标识?搜索条件
(1)
协议: URL 的起始部分, 直到包含到第一个冒号.location属性
hash: Specifies an anchor name in the URL.
host: Specifies the host and domain name, or IP address, of a network host.
hostname: Specifies the host:port portion of the URL.
href: Specifies the entire URL.
pathname: Specifies the URL-path portion of the URL.
port: Specifies the communications port that the server uses.
protocol: Specifies the beginning of the URL, including the colon.
search: Specifies a query.
location方法
reload: Forces a reload of the window's current document.
replace: Loads the specified URL over the current history entry.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。