AJAX动态加载

function getData() {
.ajax({
type: "get",
url: "dataAjax.jsp",
data: {
type: "spendList",
account: '<%=StringUtil.escapeForJavaScript(account)%>',
gopage: currentpage,
cardNumber: '<%=StringUtil.escapeForJavaScript(cardNumber)%>',
wechat: "<%=StringUtil.escapeForJavaScript(wechat)%>",
appid: "<%=StringUtil.escapeForJavaScript(appid)%>",
searchStr:('.infinite-scroll-preloader').remove();//移除加载
}
} else {
.hideIndicator();
}
})
}

function renderHtml(data) {
    $.each(data, function (i, item) {
        var temp = "";
        var datastr = {
            "jyje": item.jyje,
            "jyrq": item.jyrq,
            "jysj": item.jysj,
            "jydd": item.jydd
        };
        
            //消费
            temp = getSpemdTemplate(datastr)+"
"; //添加到相应位置的id $("#spendList").append(temp); $("#spendList").addClass('billListLi'); }) } function getSpemdTemplate(datastr) { //花费模板 var templist = $("#spend").html(); return parsetList(templist, datastr); } //替换模板 function parsetList(str, o, regexp) { if (!str) return ''; return str.replace(regexp || /\\?\??{([^\??{}]+)\}/g, function (match, name) { return (o[name] === undefined) ? '' : o[name]; }); } function search(){ $("#spendList").empty(); getData(); }

你可能感兴趣的:(AJAX动态加载)