Skip to content

Instantly share code, notes, and snippets.

@lmeyer
Created September 9, 2013 15:22
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 lmeyer/6497125 to your computer and use it in GitHub Desktop.
Save lmeyer/6497125 to your computer and use it in GitHub Desktop.
Url getters in jQuery
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