locatoin 的一些属性

var url = http://www.abc.com:8080/a/b/c?a=1&b=2&c=3

  1. location.search = ?a=1&b=2&c=3
  2. location.hostname = www.abc.com
  3. location.protocol = http:
  4. location.pathname = /a/b/c
  5. location.assign('url') 等价于 location = 'url' 等价于 location.href = 'url'
  6. location.replaceWith('url'):当前页面替换,且没有回退按钮。
  7. location.reload(true/false) 是否忽略缓存刷新。

你可能感兴趣的:(cat)