标签:
<script language="javascript"> var t = JSON.parse(‘{"name":123}‘); //反序列化 alert(t.name); var student = new Object(); student.name = "Lanny"; student.age = "25"; student.location = "China"; var ar = new Array(); for(var i = 0 ;i<8;i++){ var elelem = new Object(); elelem.name = ‘aa‘+i; elelem.age = ‘bb‘+i; ar.push(elelem); } student.par = ar; var json = JSON.stringify(student); //序列化 alert(student); alert(json); </script>
控制器:
JsonConvert.DeserializeObject<WebImage[]>(_ImgJson); //反序列化
JsonConvert.SerializeObjectobject); //序列化
标签:
原文地址:http://www.cnblogs.com/lizhenlin/p/5641911.html