_Ajax
简介
简单封装的ajax库
支持post和get方法 兼容IE7及以上浏览器
和jQuery Ajax格式相似
源码
源码
更新
已更新jsonp跨域支持
api
option
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| _Ajax({ "url":"", "method":"", "async":true, "data":{ }, "header":{ }, "cache":true, "dataType":"", success:function(){ }, beforeSend:function(){ } })
|
libs:
通过 <script>标签引入<script src="lib/_Ajax.min.js" type="text/javascript" charset="utf-8"></script>
通过CDN获取http://ajax-10030624.file.myqcloud.com/_Ajax.js
http://ajax-10030624.file.myqcloud.com/_Ajax.min.js
example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>_Ajax_Demo</title> <script src= " lib/_Ajax.min.js" type="text/javascript" charset="utf-8"></script> </head> <body> <script type="text/javascript"> _Ajax({ "url":"server.php", "method":"post", "async":true, "data":{ "key":"value", "key2":"value2" }, "header":{ "h":"c", "h2":"c2" }, "cache":true, "dataType":"json", success:function(data){ }, beforeSend:function(){ } }) </script> </body> </html>
|