Skip to content

Instantly share code, notes, and snippets.

@akofman
Last active August 29, 2015 14:01
Show Gist options
  • Save akofman/ecf2a40ea5bbe559d525 to your computer and use it in GitHub Desktop.
Save akofman/ecf2a40ea5bbe559d525 to your computer and use it in GitHub Desktop.
JavaScript Reminders

Easily parse an url with JavaScript :

var url = document.createElement('a');
url.href = 'http://www.mydomain.com/path?param=value'

and then we can access every properties of this element : http://www.w3schools.com/jsref/dom_obj_anchor.asp such as :

url.pathname //=>/path 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment