$(function () { $("#btnget"). Click (function() {$.ajax ({type:"Post",//type: (string) request mode, post or getDataType: "JSON",//DataType: (string) The expected return data type. Xml,html,json,text, etc.URL: "Data.ashx",//URL: (string) The address of the sending request, which can be a server page or a WebService action. Successfunction(msg) {varstr = ""; for(Iinchmsg) {STR+ = "<tr><td>" + msg[i].id + "</td><td>" + msg[i].name + "</td><td>" + Msg[i].cla + "</td><td>" + msg[i].sex + "</td><td>" + Msg[i].tel + "</td></tr& gt; "; } $("Tbody"). append (str); } Error:function() {alert ("Error"); } }); }); }); </script>Front CodeString data = "[{\" id\ ": \" 2010324268\ ", \" name\ ": \" Jason \ ", \" cla\ ": \" 10 software \ ", \" sex\ ": \" male \ ", \" tel\ ": \" 13800138000\ "},{\ "id\": \ "2010324256\", \ "name\": \ "John Doe \", \ "cla\": \ "10 network \", \ "sex\": \ "female \", \ "tel\": \ "10010\"},{\ "id\": \ "2010324264\", \ "name\": \ "Zhang san \", \ "cla\": \ "10 software \", \ "sex\": \ "male \", \ "tel\": \ "10086\"}] "; context. Response.Write (data);
server-side return JSON dataAnalysis of Ajax request JSON data and use JS to parse [go]