AJAX总结

一,ajax简介
异步提交技术(js中)

二,分类
1,原生态ajax技术
XMLHttpRequest
1),创建对象
2),调用open('get','url',true)方法
3),调用回调函数,接收返回来的信息
4),发送信息(send(null/参数))

2,jquery中ajax技术
1,$.ajax({
type:'get',
url:'check',
data:{user:'李四',pwd:'123'},
success:function(mess){
alert(mess);
}
});

2,$.get(url,{},function(){...});

3,$.post(url,{},function(){...},'json');

三,json
String: "刘诗诗"
数字: 23
boolean: true
null
对象
数组

对象: {"name":"lisi","age":23,"isp":true} 对象.属性名
数组: ["李四","23","男"] 数组[下标]

原文地址:https://www.cnblogs.com/afengboke/p/4610828.html