数据库内容更新了,手动刷新页面数据也显示,只是单击保存按钮后,数据不在页面上显示,应该是点击保存按钮后在图中红色位置刷新出一条数据的,求大佬解惑
//代码如下:
$.ajax({
url:'workbench/activity/createMarketActivityRemark.do',
data:{
noteContent:noteContent,
activitiesId:activitiesId
},
type:'post',
success:function(data){
if(data.success){
//清空输入框
$("#remark").val('');
//更新备注列表
var htmlStr="";
htmlStr+="<div id='del_div_"+data.mar.id+"' class='remarkDiv' style='height: 60px;'>";
htmlStr+="<img title='${user.name}' src='image/user-thumbnail.png' style='width: 30px; height:30px;'>";
htmlStr+="<div style='position: relative; top: -40px; left: 40px;' >";
htmlStr+="<h5>"+data.mar.noteContent+"</h5>";
htmlStr+="<font color='gray'>市场活动</font> <font color='gray'>-</font> <b>${ma.name }</b> <small style='color: gray;'> "+data.mar.noteTime+" 由${user.name}创建</small>";
htmlStr+="<div style='position: relative; left: 500px; top: -30px; height: 30px; width: 100px; display: none;'>";
htmlStr+="<a remark-id='"+data.mar.id+"' name='editA' class='myHref' href='javascript:void(0);'><span class='glyphicon glyphicon-edit' style='font-size: 20px; color: #E6E6E6;'></span></a>";
htmlStr+=" ";
htmlStr+="<a remark-id='"+data.mar.id+"' name='removeA' class='myHref' href='javascript:void(0);'><span class='glyphicon glyphicon-remove' style='font-size: 20px; color: #E6E6E6;'></span></a>";
htmlStr+="</div>";
htmlStr+="</div>";
htmlStr+="</div>";
$("#remarkDiv").before(htmlStr);
}else{
alert("保存失败");
}
}
});
});
$("#remark").val('');。。。。
。。
$("#remarkDiv").before(htmlStr);
你id都整清楚了没有。。自己f12打开浏览器开发工具看报错了没有
htmlStr+="</div>";
alert(htmlStr)///////////加这种看执行了没有
$("#remarkDiv").before(htmlStr);
试试:可以在链接后面拼接一个没有用的参数,让它每次不一样就行("workbench/activity/createMarketActivityRemark.do?sj="+new Date(),)