Skip to content

Instantly share code, notes, and snippets.

@boldfacedesign
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boldfacedesign/10775868 to your computer and use it in GitHub Desktop.
Save boldfacedesign/10775868 to your computer and use it in GitHub Desktop.
Property Description
hash Returns anchor portion of the URL, including the leading hash. (“#results”)
host Returns the hostname and port (if available) of a URL. (“www.example.com” or “www.example.com:80″)
hostname Returns the hostname portion of the URL (“www.example.com”)
href Returns the entire URL. (“http://www.example.com:80/example.php?x=1&y=2#results”)
pathname Returns the path name of the URL (“/example.php”)
port Returns the port portion of the URL (“80″ within the host “www.example.com:80″)
protocol Returns the protocol portion of the URL, including the trailing colon (“http:”, “https:”, “ftp”, etc)
search Returns the query portion of the URL, including the question mark (“?x=1&y=2″)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment