I receive this data when I call my api
[{"DispatchNo":"xxxxx","DispatchDate":"xxxxxxx","Complete":"xxx","CustomerID":"xxxxx","Name":"xxxxxx","Contact":"","Phone":"xxxxx","ShipPhone":"xxxx","PurchaseOrder":"xxxx","OrderLoads":"5","OrderQty":"125","FreightUnitID":"x
my controoller.js code where it indicates failure is:
var jsonString = result.data.replace(/\\/g, "\\");
var orderFromApex = JSON.parse(jsonString);
orderFromApex = orderFromApex.substring(0);
console.log(orderFromApex);
//orderFromApex += '"';
orderFromApex = JSON.parse(orderFromApex);
console.log(orderFromApex);
I get error SyntaxError: Unexpected token C in JSON at position 898 at JSON.parse () I believe it is failing at orderFromApex = JSON.parse(orderFromApex). I am also console logging orderFromApex which I have posted above. What is going on? is there a problem with my JSON response?
"
's, which makes it invalid. Specifically the portion:"comment3":"door to office "Call derek before Dumping.""
orderFromApex.substring(0);
wat