setInterval("GetData()",100);
});
function GetData()
{
$.grep(json,function(temp){
$("#dvUser").empty();
$("#dvUser").append("<div title='"+temp.state+"'>"+temp.info+"</div>");
});
});
}
{
Response.Expires = -1000;
DataTable dt=从数据库获取的数据;
{
Response.End();//不要忘记这个,不然输出一大串html代码
return;
}
string json = "";
Response.Write("[");
for (int i = 0; i < dt.Rows.Count; i++)
{
json += (json.Length > 0 ? "," : "") +"{info:'" + dt.Rows[i]["StateInfo"].ToString() + "',state:'" + dt.Rows[i]["iState"].ToString() + "'}";
}
Response.Write(json + "]");
Response.End();
}