790
社区成员
发帖
与我相关
我的任务
分享
function pullDownAction () {
setTimeout(function () { // <-- Simulate network congestion, remove setTimeout from production!
var el, li, i;
el = document.getElementById('thelist');
/* 从数据库读取新的数据 */
$.ajax({
type:"get",
url:"../Handler.ashx",
success:function(json){
$.each(json.data, function (i) { $('#thelist').append("<li>姓名:" + json.data[i].VideoTitle + "</li>"); })
$("#thelist").listview("refresh");
}
}); //把这一段代码单独放在另外的页面能够实现数据绑定
//以下是网上的静态添加的例子,
for (i=0; i<3; i++) {
li = document.createElement('li');
li.innerText = 'Generated row ' + (++generatedCount);
el.insertBefore(li, el.childNodes[0]);
}
myScroll.refresh(); //数据加载完成后,调用界面更新方法 Remember to refresh when contents are loaded (ie: on ajax completion)
}, 1000); // <-- Simulate network congestion, remove setTimeout from production!
}