Reputation: 12555
I have a string returned from the server in my object property : (R.Message)
"{
error:{
titleName:"||BroadcastableException_Title",
errorDescriptionName:"||BroadcastableException_Description",
errorMessageParameters:"",
message:"\u003cb\u003e\u003ci\u003eBroadcast\u0027s status has been changed \u003c/i\u003e\u003c/b\u003e",
stackTrace:" XXXX\\XXX.asmx.cs:line 851"
}
}"
I can use
(eval('(' + R.Message + ')')
But JSON.parse dosen't work
JSON.parse(R.Message)
I have this error :
Uncaught Invalid JSON: {error: {titleName:"||BroadcastableException_Title",errorDescrip .
Why Eval function can create object from this string but JSOn.parse can't?
I tried $parseJSON and I got the same error.
Upvotes: 0
Views: 703