Created
January 21, 2012 18:39
-
-
Save lucagrulla/1653543 to your computer and use it in GitHub Desktop.
get params for URL
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
function getParamsFrom(url) { | |
var seq = url.split("?").pop().split("&") | |
var params = {}; | |
$.each(seq, function(k, v) { | |
tmp = v.split("="); | |
params[tmp[0]] = tmp[1]; | |
}); | |
return params; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment