html调用静态json例子
1.json
{"current": 2,"result": "success" }
1.html
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript"> $(function(){$("#BTN1").click(function(){$.ajax({url: "1.json",dataType: "json",success: function(data){if(data === undefined){return false;}alert(data.current);alert(data.endPage);}})});}); </script> </head> <body> <h1>调用静态json例子</h1> <input type="button" value="BTN1" id="BTN1"> </body> </html>
posted on 2014-07-04 11:22 bjhhh 阅读(...) 评论(...) 编辑 收藏