Home > DeveloperSection > Forums > Json Converted array is a string?
Hugh Jackman
Hugh Jackman

Total Post:52

Points:366
Posted on    June-20-2013 3:05 AM

 JSON JSON 
Ratings:


 1 Reply(s)
 1141  View(s)
Rate this:
Hi Expert, 

I've converted an array inside c# to json (This ugly escaping bahh). Loaded it into javascript. Should be an array. Right now it's a string. How to solve this. What is wrong here ?

["\u003cdiv\u003e\u003ch1\u003eText\u003c/h1\u003e\u003cp\u003eText. Text\u003cbr/\u003eText changes and Text\u003cbr/\u003eText\u003cbr/\u003ebase.\u003c/p\u003e\u003cbr/\u003e\u003ch1\u003eRequirements\u003c/h1\u003e\u003cp\u003e.Text Text\u003c/p\u003e\u003cbr/\u003e\u003ch1\u003eLicensing\u003c/h1\u003e\u003cp\u003eFree / 

Text\u003c/p\u003e\u003cbr/\u003e\u003ch1\u003eDownload\u003c/h1\u003e\u003ca href=\u0027Text\u0027\u003eZIP-Archiv,Text\u003c/a\u003e\u003c/div\u003e","\u003cdiv\u003e\u003cvideoposter=\u0027./Image/poster.png\u0027controls\u003e\u003csource src=\u0027./Content/Video/video.mp4\u0027 type=\u0027video/mp4\u0027\u003e\u003c/video\u003e\u003c/div\u003e"]

[{"Content":"[\"\\u003cdiv\\u003e\\u003ch1\\u003eText\...

Thanks in advance for any recommendations or solutions.



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    June-20-2013 6:58 AM

You can use JSON.parse to deserilize it.

var array = JSON.parse(myJsonString);


Don't want to miss updates? Please click the below button!

Follow MindStick