1.ajax是一种什么技术?优点是什么?
是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术
提升了用户体验
2.ajax有几种实现方式?
(1) 原生的JS实现方式
(2)JQeury实现方式:1.$.ajax({键值对}); 2.$.get(url, [data], [callback], [type]) 3.$.post(url, [data], [callback], [type])
3.json是什么?优点是什么?
是JavaScript对象表示法
JSON 比 XML 更小、更快,更易解析
4.json的格式有几种?
基本格式:
(1)var person = {"name": "张三", age: 23, 'gender': true};
(2) var ps = [{"name": "张三", "age": 23, "gender": true},
"name": "李四", "age": 24, "gender": true},
{"name": "王五", "age": 25, "gender": false}];
嵌套格式:[]———> {}
var ps = [{"name": "张三", "age": 23, "gender": true},
{"name": "李四", "age": 24, "gender": true},
{"name": "王五", "age": 25, "gender": false}];
[]———> {}
var ps = [{"name": "张三", "age": 23, "gender": true},
{"name": "李四", "age": 24, "gender": true},
{"name": "王五", "age": 25, "gender": false}]; |