I have this answer from an API (written by me):
[[new Date(2017,0,28,16,00,00),[0.201766,0.201766,0.201766],[0.309878,0.309878,0.309878],[0.287467,0.287467,0.287467],[null,null,null], ...
I want my view to interpret this answer as javascript, but it doesn't. It assumes it is a string.
$.getJSON('http://localhost:XXXX/...', function (data) {
// data.jsAlignedData == [[new Date(2017,0,28,16,00,00),[0.201766,0.201766,0.201766], ...
console.log(data.jsAlignedData);
// Shows it as a string
var test = JSON.parse(data.jsAlignedData);
// Error: Unexpected token e in JSON at position 3
// (IMO it's the 'e' from 'new')
// it doesn't even reach this point:
console.log(test);
}
The final goal is to build a Dygraphs plot with a native array for increased speed (see "native array" in the documentation).