echarts_04

通过ajax加载本地文件:

1.http://www.cnblogs.com/qjqcs/archive/2016/09/07/5850282.html

2.http://blog.csdn.net/sheila1227/article/details/44035561

3.http://blog.csdn.net/sheila1227/article/details/44157117

4.http://blog.csdn.net/dandanzmc/article/details/31344267/

 

 

5.http://www.cnblogs.com/xiaojinhe2/archive/2011/10/12/2208740.html

6.http://www.cnblogs.com/leejersey/p/3750232.html

7.http://www.2cto.com/kf/201412/357442.html

8.https://my.oschina.net/crazymus/blog/345586

9.http://blog.csdn.net/zhangdaiscott/article/details/18456215

 

10.http://www.php100.com/manual/jquery/serialize.html

11.http://www.php100.com/manual/jquery/jQuery.Ajax.html

 

jQuery插件之json篇:

12.http://www.cnblogs.com/luluping/archive/2009/04/22/1441495.html

 

HTML文件:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title></title>
    <script src="jquery-2.0.0.js"></script>
    <script type="text/javascript">
     $(document).ready(function() {  
    $.ajax({  
        //请求方式为get  
        type:"GET",  
        //json文件位置  
        url:"user.json",  
        //返回数据格式为json  
        dataType: "json",  
        //请求成功完成后要执行的方法  
        success: function(data){  
            //使用$.each方法遍历返回的数据date,插入到id为#result中  
            $.each(data,function(i,item){  
                var content=item.name+","+item.email+","+item.gender+  
				","+item.hobby[0]+","+item.hobby[1]+"</br>";  
                $("#result").append(content);  
            })  
        }  
    })  
}); 
    </script>
</head>

<body>
    <dir id="result">1</dir>
</body>

</html>

  

json文件:

[  
    {"name":"哈哈··","email":"邮箱01","gender":"男","hobby":["上网","打球"]},  
    {"name":"呵呵··","email":"邮箱02","gender":"男","hobby":["网购","打球"]}  
] 

  

posted @ 2016-11-16 23:33  aWolfMan  阅读(201)  评论(0编辑  收藏  举报