Created
March 27, 2015 11:50
-
-
Save BlackMac/2d5e8706c42e9b03ba13 to your computer and use it in GitHub Desktop.
very basic post parser
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
parsePost = function(input) { | |
var result = {}; | |
var parts = input.split("&"); | |
parts.forEach(function(part) { | |
var divided = part.split("="); | |
result[divided[0]] = divided[1]; | |
}); | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment