先附代码
.ashx
public void BindTableBy(HttpContext context)
{
string brname = context.Request.Params["brname"];
string devid = context.Request.Params["devid"];
List<view_main> reals = BssView.Instance.DataTableToList(BssView.Instance.GetList(devid, brname).Tables[0]);
string json = ObjectToJson<view_main>("linkcn", reals);
string str = context.Request.QueryString["dachie"] + "(" + json + ")";
context.Response.Write(str);
}
str=jsonp1308108908538({"linkcn":[{"Branch_code":"GUNUPS-1"
}]})
$("tableSetI").html('')
var bind = "bind";
var brname = "xx";
var devid = "xx";
$.getJSON("/Handler/BindHandler.ashx?me="+bind+"&brname="+brname+"&devid="+devid+"&dachie=?", function (json) {
alert(json);
$.each(json.linkcn, function (i, item) {
obj.append("<tr><td class=\"tdRI\"> " + item.Dev_type_para_name + "</td><td class=\"tdRI\">" + item.Data_value + "</td></tr>");
});
});
}
jsonp1308108908538({"linkcn":[]})
jsonp1308108908538({"linkcn":[{"Branch_code":"GUNUPS-1"
}]})
这是为什么呢,多出1个 为空的来