[{"UserId":"33443","NickName":"张三","Pass":null,"CreateTime":"0001-01-01T00:00:00"},{"UserId":"3344","NickName":"July","Pass":null,"CreateTime":"0001-01-01T00:00:00"},{"UserId":"123456","NickName":"辣椒","Pass":null,"CreateTime":"0001-01-01T00:00:00"}]
这些是由后台通过http协议返回回来的字符串,想读取,具体方法能不能帮我写下啊?
$(function(){
$.post("url", function(data){
for(var i=0; i<data.length; i++ ) {
var obj=data[i];
var id=obj.UserId;
var name=obj.NickName;
}
});
});
先解析成 json数据, var jsonData=eval('('+dataStr+')');
$.JSON(str)
成为JSON对象后,就好操作了
你要在js里面解析 还是在c# 程序里面解析?