1.html
拿到html可以直接在div中进行显示
2.拿到json数据可以用来进行解析
$.post("test.json",function(response,status,xhr) {
alert(response[0].url);
},"json");
3.拿到xml进行解析
$("#btn").click(function() {
$.post("test.xml",function(response,status,xhr) {
alert($(response).find("root").find("url").text());
},"xml");
})
4.直接请求json数据
$.getJSON("test.json",function(response,status,xhr) {
alert(response[0].url);
});