網址location的屬性解析

http://www.example.com/test.htm#part2?name=michael  hash          Returns the anchor portion of a URL host           Returns the hostname and port of a URL hostname   Returns the hostname of a URL href            Returns the entire URL pathname  Returns the path name of a URL port            Returns the port number the server uses for a URL protocol     Returns the protocol of a URL search        Returns the query portion of a URL hash:    #part2
host:    www.example.com:80
hostname: www.example.com
href:   http://www.example.com/test.htm#part2
pathname: /test.htm#part2?name=michael 
port:     80
protocol:  http
search:    ?name=michael
相關文章
相關標籤/搜索