Created
December 11, 2014 09:20
-
-
Save tytskyi/9d8f302ab3844851ac46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Easy way to parse raw URL without regex. | |
var locator = document.createElement('a'); | |
locator.href = 'http://google.com/?search=true&other=isnt#anchor' | |
console.log(locator.protocol); | |
console.log(locator.host); | |
console.log(locator.search); | |
console.log(locator.hash); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment