路径

http://yaoxin.test.jidecai.com:10080/h/rule/ranger.html

效果图

window对象详解(动态获取接口路径origin)

 

传参前边的URL:window.location.origin(可用来动态获取接口)

"http://yaoxin.test.jidecai.com:10080"

域名 + 端口:window.location.host

"yaoxin.test.jidecai.com:10080"

当前URL:window.location.href

"http://yaoxin.test.jidecai.com:10080/h/rule/ranger.html"

协议:window.location.protocol

"http:"

传参前边的URL:window.location.origin

"http://yaoxin.test.jidecai.com:10080"

域名:window.location.hostname

"yaoxin.test.jidecai.com"

端口:window.location.port

"10080"

路径部分:window.location.pathname

"/h/rule/ranger.html"

请求的参数:window.location.search

""

相关文章:

  • 2021-12-17
  • 2021-07-14
  • 2022-12-23
  • 2023-03-17
  • 2021-12-07
  • 2022-01-06
  • 2022-12-23
猜你喜欢
  • 2021-07-13
  • 2022-02-16
  • 2021-11-27
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案