Common commands used by javascript to obtain the current information. Common commands used by javascript
The content of this article is very simple. I would like to summarize some common commands for javascript to obtain the current information.
Console.info ("document. URL =" + document. URL );
Console.info ("document. location. href =" + document. location. href );
// Console.info ("document. base =" + document. base); // This is incorrect!
Console.info ("document. location =" + document. location );
Lele.info ("self. location. href =" + self. location. href );
Console.info ("top. location. href =" + top. location. href );
Console.info ("location. hostname =" + location. hostname );
Console.info ("window. location. host =" + window. location. host );
Console.info ("window. location. pathname =" + window. location. pathname );
That's all you need to think about now. You can update it later. ^_^