Created
June 8, 2015 00:29
-
-
Save hhsnopek/d42b86aa729d98b3ac24 to your computer and use it in GitHub Desktop.
URL Parse
This file contains 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
var url = "", | |
obj = {}; | |
url = window.location.href.split('?')[1].split('&'); | |
for (var u = 0; u < url.length; u++) { | |
var items = url[u].split('=') | |
obj[items[0]] = unescape(items[1]); | |
}; | |
console.log(obj); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment