jq - ajax- json
来源:互联网 发布:alphago 策略网络 编辑:程序博客网 时间:2024/05/22 13:44
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> *{margin: 0;padding: 0;} ul{list-style: none;width: 320px;height: 480px;border: 1px solid lightgray;margin: auto;overflow:scroll;} li{background: cyan;margin-bottom: 20px;} </style> </head> <script src="js/jquery-2.1.1.js"type="text/javascript"charset="utf-8"></script> <script type="text/javascript"> $(function(){ var arrAllData = []; $.ajax({ type:"get", url:"4.json", async:true, success:function(res){ console.log(res); arrAllData = res.product; setData(); } }); function setData(){ for (var i = 0; i < arrAllData.length; i++) { var liObj = $('<li><p></p><p></p><p></p></li>'); var obj = arrAllData[i]; liObj.find('p').eq(0).text(obj.product_name); liObj.find('p').eq(1).text(obj.product_price); liObj.find('p').eq(2).text(obj.service_desc1); $('#list').append(liObj); } } }) </script> <body> <ul id="list"></ul> </body> </html>
0 0
- jq+json+ajax demo
- jq - ajax- json
- str2-json-jq-ajax
- JQ笔记(jQuery + ajax + json)入门
- Ajax、json,原生JS和JQ使用Ajax
- jq ajax
- jQ-ajax
- jq ajax
- JQ AJAX
- jq ajax
- 使用JQ的AJAX来读取JSON文件
- jq代码学习22----- ajax $.getJSON()获取json文件
- PHP+JQ+AJAX+json 数据库实时动态增删改查
- jq-json query工具
- JQ读取Json
- js/jq解析json
- jq遍历json/数组
- linux json工具 jq
- POJ 1383 Labyrinth
- jquery对象与DOM对象的相互转换
- eclipse-- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Jquery 传json格式数据到后台,后台反序列化得到一个集合list
- 'Android Dependencies' 报错,有红叉
- jq - ajax- json
- Android避免内存溢出(Out of Memory)方法总结
- 哈哈哈2
- Java程序员的修炼之路<1>菜鸟篇(1年)
- redis安装和使用
- 【华为 OJ】 整型数组合并
- refresh的停车场
- leetcode--016. 3Sum Closest
- 【POJ 3414】Pots(BFS)