Created
January 12, 2016 09:37
-
-
Save cmatskas/5804bdff1e485af22caf to your computer and use it in GitHub Desktop.
ParseUrl.js
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
var parseQueryString = function(url) { | |
var urlParams = {}; | |
url.replace( | |
new RegExp("([^?=&]+)(=([^&]*))?", "g"), | |
function($0, $1, $2, $3) { | |
urlParams[$1] = $3; | |
} | |
); | |
return urlParams; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment