I've got
var data = `[
{ cod: 2, tipo: 'MAÑANA' },
{ cod: 4, tipo: 'NOCHE' },
{ cod: 3, tipo: 'TIENDAS V.O.' }
]`;
When doing the json pass I get an error:
var aData = JSON.parse(data);
With eval it works fine.
var data = eval(data);
What is the problem with the parse?
You are confusing the syntax of a Javascript object with JSON: JSON is a more strict notation:
Therefore a valid JSON would be:
By the way, I advise you to use single quotes to delimit text in Javascript, that way you can use double quotes internally without having to escape them
"\"así\""