window location的属性说明

var href  =  window.location.href;//完整的url
var protocol  =  window.location.protocol;//协议
var hostname  =  window.location.hostname;//主机名
var host  =  window.location.host;//主机名+端口号
var port = window.location.port;//端口号
var pathname = window.location.pathname;//当前URL的路径部分
var search = window.location.search;//路径的查询部分
var hash = window.location.hash;//开始的锚点

结果

window location的属性说明

相关文章:

  • 2021-09-22
  • 2021-08-08
  • 2021-09-30
  • 2017-12-01
  • 2021-11-16
  • 2021-09-30
  • 2021-08-16
  • 2019-02-01
猜你喜欢
  • 2021-09-30
  • 2021-09-22
  • 2021-11-21
  • 2021-09-30
  • 2021-09-17
  • 2021-09-22
  • 2021-11-12
  • 2021-11-08
相关资源
相似解决方案