ajax数据请求

load 用来请求公共部分;

比如copy里面的div 想要请求tpl里面的ul;

 //  load方法
$("div").load('tpl.html',function (data) {
console.log(data);
});

//post与get方法
$.post('tpl.html',function (data) {
console.log(data);
$("div").append(data)
});

$("div").load("tpl.mtml",function(data){

  data里面包含请求的数据

})

 

post 与get也是请求一个load都相似;

 

posted @ 2017-06-21 08:28  yaomengli  阅读(124)  评论(0编辑  收藏  举报