【发布时间】:2014-08-23 05:45:57
【问题描述】:
我的ajax代码是
function senddata()
{
var ajaxRequest; // The variable that makes Ajax possible!
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function()
{
if(ajaxRequest.readyState == 4)
{
document.getElementById("showdata").innerHTML=ajaxRequest.responseText;
}
}
ajaxRequest.open("GET", Handler.php?key=" + value, true);
ajaxRequest.send(null);
}
我有大量通过 ajax 检索的数据。现在当我调用这个函数时,显示数据需要很长时间。我想要的是,当数据被检索时,它应该显示在屏幕上。无需仅在获取所有内容时显示整个检索到的数据,而是在获取数据时显示数据。
【问题讨论】:
-
逐页获取数据(例如限制100)并追加
标签: javascript ajax