日期:2014-05-16 浏览次数:20774 次
<script src="jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
chat();
run();
var interval;
function run() {
interval = setInterval(chat, 5000);
}
function chat() {
$.post("scjk.ashx", function (data) {
var strs = new Array();
strs = data.split(",");
for (var i = 0; i < strs.length; i++) {
$("#Label" + i.toString()).text(strs[i]);
}
});
}
</script>
。。。数据库读取操作。。。
for (int i = 0; i < dtData.Columns.Count; i++)
{
strText = strText + dtData.Rows[0][i] + ",";
}
strText = strText.Substring(0, strText.Length - 1);
// 输出
context.Response.ContentType = "text/plain";
context.Response.Write(strText);