Details about window. location, window. location
Properties of the window. location object
Hash // The URL (Anchor) starting from)
Host // host name and port number of the current URL
Hostname // host name of the current URL
Href // complete URL
Pathname // the path of the current URL
Port // The port number of the current URL
Protocol // protocol of the current URL
Search // question mark (?) Start URL
To use JS to locate the anchor, you can use window. hash with the element ID.
You can use window. location. search to capture the parameters requested by page get in JS, and then use the split method in combination with loop traversal to freely organize the data format.
What is windowtoplocation used? You can not give a detailed explanation. It is better to give an example,
Is the address object of your top-level webpage page.
For example, the location. href of the page that Baidu knows is
Zhidao.baidu.com/question/88553493.html
Location is an object that includes the address mentioned above. There are some other methods,
For example, replace (replace address), and attributes such as href (address)
As for top, it indicates a top-level page, because the page may be embedded with sub-pages such as frame, top indicates the outermost layer.
Windowlocation = url + "? Id = "+ id is what, especially + "? Id = "why is there a + id?
Window. location = This is followed by a string, where "? Id = "indicates the parameter name" id ". To add a value to the parameter name" id ", connect with the" + ". The variable id is the specific value to be included.
For example:
Var url = "abc. jsp ";
Var id = "123 ";
Window. location = url + "? Id = "+ id ---> resolved to window. location =" abc. jsp? Id = 123 ";