What do the various location object properties mean?

Firat Tiryaki

1. hash
Refers to any internal anchors of the URL, including the '#' sign. Changing this will change the anchor reference portion of the URL.

2. host
The hostname:port of the URL. Changing this will change the hostname & port of the URL.

3. hostname
The hostname portion of the URL. Changing this will change the hostname of the URL.

4. href
The complete URL of the link. Changing this will change the URL of the link.

5. pathname
The portion of the URL after the host and port. Changing this will change the path of the URL.

6. port
The port portion of the URL. Changing this will change the port of the URL.

7. protocol
The protocol of the URL ("http:","ftp:","gopher:", etc). Changing this will change the protocol of the URL.

8. search
The query portion of the URL (Anything including and after the "?" character). Changing this will change the search portion of the URL.

Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact