5.Location对象.js 458 B

123456789
  1. // hash 设置或返回从井号 (#) 开始的 URL(锚)
  2. // host 设置或返回主机名和当前 URL 的端口号
  3. // hostname 设置或返回当前 URL 的主机名
  4. // href 设置或返回完整的 URL
  5. // pathname 设置或返回当前 URL 的路径部分
  6. // port 设置或返回当前 URL 的端口号
  7. // protocol 设置或返回当前 URL 的协议
  8. // search 设置或返回从问号 (?) 开始的 URL(查询部分)
  9. // console.log(location.hash);