JSFiddle - React, Tailwind, and code Playground
JavaScript
function postirify(obj) {
var tmp = $.param(obj).split("&");
console.log(tmp);
var result = [];
$.each(tmp, function(i, v) {
var kv = v.split("=");
result.push({
key: decodeURIComponent(kv[0]),
value: decodeURIComponent(kv[1])
});
});
return result;
}
var x =
{
"hello" : {
"foo" : "bar",
"arr" : ["a", "b", "c"]
},
"another": {
"go" : {
"very" : {
"deep" : 1
}
}
}
}
$.each(postirify(x), function(i, v) {
$("body").append("<div>key : " + v.key + " // value : " + v.value + "<br/>");
});