AjaxPro 和 JS的问题。

jasmine5288 jasmine5288 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
提交后,数据写入数据库。
在CS文件中返回最新一条数据的DataTable给get_Result_CallBack


function get_Result_CallBack(response)
{
if (response.value != null)
{
z = 0;
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Rows != null)
{
arrCellText[0] = ds.Rows[0].Message+"   "+ds.Rows[0].UpdateDate ;
arrCellText[1] = ds.Rows[0].Name ;
arrCellText[2] = "<a href='"+ds.Rows[0].ID+"'>回复</a>" ;//这里暂时先这样写着
arrCellText[3] = "<a href='"+ds.Rows[0].ID+"'>删除</a>";//这里暂时先这样写着
var resulttable= "tab"+ds.Rows[0].Img_ID;//这个是DataList中的table,我给table的命名是tab加上该条数据的ID
var resulttr= "tr"+ds.Rows[0].Img_ID;
_tab = document.getElementById(resulttable) ;
_tr = document.getElementById(resulttr) ;
createRowCell(_tab, _tr, arrCellText) ;
}

}
return
}

function createRowCell(tab, tr, arrCellText)
{
trNew = tab.insertRow(0) ;
for(var i=0; i<tr.cells.length; i++)
{
//alert(arrCellText[i]);这里可以弹出我每个字段的值。
var tdNew = trNew.insertCell() ;
var tnNew = document.createTextNode(arrCellText[i]) ;
tdNew.appendChild(tnNew) ;
}
}


问题是 相应的这个Table没有任何反应。页面也无任何反应,没有刷新。自己手动刷新一下,数据就会显示出来。


我代码哪里有问题,还是逻辑上不对?希望大家多指教
...全文
评论 4
收藏 已收藏
分享
返回顶部
jasmine5288
.NET社区 62,271 成员 668,968 内容