Created
April 3, 2010 23:28
-
-
Save sh1mmer/354941 to your computer and use it in GitHub Desktop.
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 data = ""; | |
| for (p in parameterMap) { | |
| data += p + "=" + encodeURIComponent(parameterMap[p]) + "&"; | |
| } | |
| //kill the trailing & | |
| data = data.slice(0,-1); |
since you are already looping over the object...
var data = [];
for (p in parameterMap) {
data.push(p + '=' + encodeURIComponent(parameterMap[p]));
}
//kill the trailing &
data = data.join('&');
Author
Whoops. Already revved it over here: https://gist.github.com/354949/76df91273a5be7370f0df004f934dad95a6d3e23
Thanks for the suggestions :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// assuming you have es5 Object.keys will be slower though