I am not able to figure out what is the problem with JSON in the following code.
This is working fine:
var a = JSON.parse('[{"label":"not applicable"},{"label":"see items"},{"label":"40 days"},{"label":"suntest"}]');
But this throws an exception, "Invalid Character" :
var b = JSON.parse('[{"label":"234"},{"label":"Sunny AG, Sunny Me- Be Cars, Ben., Bu 60, DE 71059, Sind, Discharge p no. 9711\r\n"},{"label":"C207346"}]');
While debugging I copied above runtime code. Actual code is in C# MVC as:
var a= JSON.parse('@Html.Raw(Json.Encode(Model.ShipToAddressCodeList))');