Home > Article > Web Front-end > Jquery asp.net background data is transferred to the front-end js for analysis_json
So when parsing the background data, we need to process and treat it specially according to the background data situation.
What I use in the background here is the wcf service provided by asp.net, and there is also an ashx general processing program. The general principle is almost the same.
The objects we often use in C# include entity objects such as User; there are List collections, which generally return lists.
Somewhat more complicated are objects nested in objects or list collections. But there is no difference. Just look at the size of your data to decide whether js will process the data,
It is still processed in the background and returns the final result directly.
1. Entity object: If the returned object is an object, in js, it is directly the same as the object data in your background code class.
For example, the following code obtains an object. You can get it directly by using its name attribute.
2. The returned data is a List collection, including some objects: there are many application scenarios for this.
In js, the corresponding array array. The array contains the object entities you return. You can use each traversal. For details, please refer to:
[Jquery operation js array and object examples]
demo:
$.each(data.comments, function(i, item) {
< /div>""