标签:.ajax pts strong blog 数据 span jquer jquery rip
list.txt内容
[ {"optionKey":"1", "optionValue":"Canon in D"}, {"optionKey":"2", "optionValue":"Wind Song"}, {"optionKey":"3", "optionValue":"Wings"} ]
JavaScript内容
<script src="~/Scripts/jQuery-1.8.2.js"></script> <script> $(function () { $.ajax({ type: "GET", url: "Content/list.txt", dataType: "json", success: function (data) { console.info(data); for (var i = 0; i < data.length; i++) { var trTD = "<tr><td>" + data[i].optionKey + "</td><td>" + data[i].optionValue + "</td></tr>"; $("#tb").append(trTD); } } }); }); </script>
Html 内容
<div> <table id="tb"><tr><td>第一个</td><td>第二个</td></tr></table> <input id="button" type="button" value="O(∩_∩)O"/> </div>
http://blog.csdn.net/qq_20916285/article/details/46695839
标签:.ajax pts strong blog 数据 span jquer jquery rip
原文地址:http://www.cnblogs.com/bincoding/p/6849720.html