Home >Web Front-end >JS Tutorial >Attributes contained in the window.location object_javascript skills
hash//URL (anchor) starting with pound sign (#)
host//Host name and port number of the current URL
hostname//The host name of the current URL
href//Full URL
pathname//The path part of the current URL
port//Port number of the current URL
protocol//The protocol of the current URL
search//URL starting with question mark (?)
To use JS to locate anchor points, you can use window.hash with the element ID.
To use JS to capture the parameters of the page GET request, you can use window.location.search to obtain them, and then use the split method combined with looping to traverse the freely organized data format.