Set a div in the interface to bind the data dynamically to the Div, and call this method when the interface loads
$ (function () {
Default comes in show first page, one page show five data
GetList (1,5);
})
function GetList (page,size) {
Assign dynamically generated HTML code to TR
var tr= "";
var url= ';
Ajaxhelper (URL, ' GET '). Done (function (DT) {
Get data from a background query
var data=eval (DT);
$ (data). each (function (Index,item) {
Loop to assign a value to the interface
tr+= ' <div class= "Tip" > Name:<span> ' + item.name+ ' </span></div> ' +
<div class= "Tip" > Gender:<span> ' + item.sex+ ' </span></div> ' +
' <div class= ' tip > Phone:<span> ' + item.tel+ ' </span></div> ' +
' <div class= ' tip > Notes:<span> ' + item. Remark + ' </span></div> ';
})
Find the div to which the interface will be assigned, and add the TR HTML
$ (' #tbody '). Append (tr);
method to invoke a drop-down refresh
Paging ();
})}
var page=1,ssize=0;
function Paging () {
$ (window). Scroll (function () {
if (document). ScrollTop () +$ (window). Height () >=$ (document). Height) {
page++;
Call Query
GetList (page,ssize);
}
})
}
JS binding data, implementation of mobile phone-side pull-down implementation Paging mobile page (MVC)