1. Introducing Scripts
2. Writing templates
2.1 Suppose there is at this time a data sent from a JSON format in the background
Copy Code code as follows:
[{"TId": 1, "Tname": "John", "Tage": "Tclass": 1, "Teachclass": {"cId": 1, "CName": "1 Classes"}},
Copy Code code as follows:
{"TId": 2, "Tname": "Dick", "Tage": "Tclass": 1, "Teachclass": {"cId": 1, "CName": "1 Classes"}},
Copy Code code as follows:
{"TId": 4, "Tname": "Zhao Liu", "Tage": "Tclass": 2, "Teachclass": {"CId": 2, "CName": "2 Class"}]
2.2 At this point you want to display the following content
Then set the template according to the content you want to display:
"Similar to Repeater control in ASPX"
"Note: Remember to set the ID"
3. Fill in the template
According to the above assumptions, the background returns a JSON-formatted string, then through the AJAX request, and fill in the template
4. See the effect page
The above mentioned is the entire content of this article, I hope you can enjoy.