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

路径

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

效果图

 

传参前边的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

""

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章