tag:local question mark return value project toc Agreement hash oca echart
1. Set or get the entire URL as a string var url=window.location.href returns the Result: URL https://www.baidu.com/2. set or get the protocol portion of the URL var Protocol= window.location.protocol; return result: http:3. set or get host var host = Window.location.host return result: www.baidu.com4. set or get URL port var port =window.location.port returns the Result: "" if you are using the default 80 port (update: Even If: 80 is added, The return value is not the default of 80 but the null Character) 5. Sets or gets the path portion of the URL with the url= "http://echarts.baidu.com/option.html"; var pathname= window.location.pathname; return result: "/ Option.html "6. Sets or gets the portion of the HREF attribute that follows the question mark Url= "http://localhost:63342/project/6-21/aa.html?_ijt=flc0nna93fr89j3dlhh9mn7eco" var param = window.location.search; Returns the result: "? _ijt=flc0nna93fr89j3dlhh9mn7eco" 7. Sets or gets the fragment url= "http://echarts.baidu.com/option.html#title.left" var param= window.location in the href attribute after the pound sign "#". A hash; returns the Result: "#title. left"
Frontend URL Related Settings Get summary