Please note that the information in this post may no longer be accurate or up to date. I recommend checking more recent posts or official documentation for the most current information on this topic. This post has not been updated and is being kept for archival purposes.

The following values allow you to grab useful information about the page you’re viewing such as the current page’s pathname or url.

Complete List of Document Values

self.location.hash       //Sets or retrieves the subsection of the href property that follows the number sign (#).       //Sets or retrieves the hostname and port number of the location or URL. 
self.location.hostname   //Sets or retrieves the host name part of the location or URL.  
self.location.href       //Sets or retrieves the entire URL as a string.  
self.location.pathname   //Sets or retrieves the path and file name associated with a URL.  
self.location.port       //Sets or retrieves the port number associated with a URL. 
self.location.protocol   //Sets or retrieves the protocol portion of a URL.     //Sets or retrieves the substring of the href property that follows the question mark

Similar Posts