157
rated 0 times
[
159]
[
2]
/ answers: 1 / hits: 57831
/ 12 Years ago, fri, may 11, 2012, 12:00:00
I want to build a JSON string programmatically. The end product should be something like this:
var myParamsJson = {first_name: "Bob", last_name: "Smith" };
However, I would like to do it one parameter at a time. If it were an array, I would do something like this:
var myParamsArray = [];
myParamsArray["first_name"] = "Bob";
myParamsArray["last_name"] = "Smith";
I wouldn't even mind building that array and then converting it to JSON.
More From » json