Skip to content

Instantly share code, notes, and snippets.

@daltonnyx
Created June 19, 2017 12:29
Show Gist options
  • Save daltonnyx/e5ff280ad7064d57a6c96c421de75be6 to your computer and use it in GitHub Desktop.
Save daltonnyx/e5ff280ad7064d57a6c96c421de75be6 to your computer and use it in GitHub Desktop.
//Here's a non-jQuery version:
function toQueryString(obj) {
var parts = [];
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
parts.push(encodeURIComponent(i) + "=" + encodeURIComponent(obj[i]));
}
}
return parts.join("&");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment