Skip to content

Instantly share code, notes, and snippets.

@joemcgill
Created October 14, 2013 22:21
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 joemcgill/6983229 to your computer and use it in GitHub Desktop.
Save joemcgill/6983229 to your computer and use it in GitHub Desktop.
Nice reference of browswer location attributes cribbed from this Stack Overflow thread: http://stackoverflow.com/questions/406192/how-to-get-the-current-url-in-javascript
http://www.refulz.com:8082/index.php#tab2?foo=123
Property Result
-------------------------------------------
host www.refulz.com:8082
hostname www.refulz.com
port 8082
protocol http
pathname index.php
href http://www.refulz.com:8082/index.php#tab2
hash #tab2
search ?foo=123
var x = $(location).attr('<property>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment