var data; var json=‘[{"CityId":18,"CityName":"西安","ProvinceId":27,"CityOrder":1},{"CityId":53,"CityName":"广州","ProvinceId":27,"CityOrder":1}]‘; eval("data="+json); alert(data); $(data).each(function(){ alert(this.CityId+" "+this.CityName); });
Posted 与f
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jquery字符串转json相关的知识,希望对你有一定的参考价值。
var data; var json=‘[{"CityId":18,"CityName":"西安","ProvinceId":27,"CityOrder":1},{"CityId":53,"CityName":"广州","ProvinceId":27,"CityOrder":1}]‘; eval("data="+json); alert(data); $(data).each(function(){ alert(this.CityId+" "+this.CityName); });
以上是关于jquery字符串转json的主要内容,如果未能解决你的问题,请参考以下文章