davidchardonnet
Programmer
Hello,
I want to convert to JSON some data i have defined in javascript like this:
var datasets =
{
"A":
{
label: "A",
data: [[new Date("2010/10/01"), 65.00],[new Date("2010/11/20"), 65.00]]
},
"B":
{
label: "B",
data: [[new Date("2010/10/01"), 57.00],[new Date("2010/11/20"), 57.00]]
},
"C": {
label: "C",
data: [[new Date("2010/10/01"), 65.00], [new Date("2010/10/12"), 64.00], [new Date("2010/10/16"), 62.50], [new Date("2010/10/24"), 61.00], [new Date("2010/11/01"), 61.50], [new Date("2010/11/09"), 78.40], [new Date("2010/11/10"), 60.00], [new Date("2010/11/18"), 57.00], [new Date("2010/11/19"), 62.00], [new Date("2010/11/20"), 75.00]] }
};
What i want to do is have this data in JSON format so i can recover the same information by a database request.
The problem is that i can't find the right way to have this data encoded to json so when i do an EVAL, the data is back in the "datasets" variable.
Can you help me?
Thank you
David
I want to convert to JSON some data i have defined in javascript like this:
var datasets =
{
"A":
{
label: "A",
data: [[new Date("2010/10/01"), 65.00],[new Date("2010/11/20"), 65.00]]
},
"B":
{
label: "B",
data: [[new Date("2010/10/01"), 57.00],[new Date("2010/11/20"), 57.00]]
},
"C": {
label: "C",
data: [[new Date("2010/10/01"), 65.00], [new Date("2010/10/12"), 64.00], [new Date("2010/10/16"), 62.50], [new Date("2010/10/24"), 61.00], [new Date("2010/11/01"), 61.50], [new Date("2010/11/09"), 78.40], [new Date("2010/11/10"), 60.00], [new Date("2010/11/18"), 57.00], [new Date("2010/11/19"), 62.00], [new Date("2010/11/20"), 75.00]] }
};
What i want to do is have this data in JSON format so i can recover the same information by a database request.
The problem is that i can't find the right way to have this data encoded to json so when i do an EVAL, the data is back in the "datasets" variable.
Can you help me?
Thank you
David