日期:2014-05-17 浏览次数:20674 次
function init() { ... //request是XMLHttpRequest request.onreadystatechange=function() { if(request.readyState==4) { if(request.status==200) { responseHandler(request); } } } request.open('GET', url, true); request.send(null); ... } function responseHandler(request) { document.getElementById("scrollDiv").innerHTML=request.responseText; scroll(); } function scroll() { document.getElementById("scrollDiv").scrollTop = {一个数}; }
setTimeout("scroll()", 0);