Created
August 29, 2010 08:53
-
-
Save taybenlor/556117 to your computer and use it in GitHub Desktop.
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 getArgs(){ | |
var url = window.location.href; | |
var qparts = url.split("?"); | |
if (qparts.length == 1){ | |
return {}; | |
} | |
var query = qparts[1]; | |
var vars = $A(query.split("&")); | |
var args = {} | |
vars.each(function(parts){ | |
parts = parts.split("="); | |
args[parts[0]] = unescape(parts[1]).replace(/\+/g," "); //unescape and turn +'s into spaces | |
}); | |
return args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment