日期:2014-05-16 浏览次数:20543 次
function getAudit(planId){ var url="audit.do?action=getAudit&planId="+planId; var myAjax = new Ajax.Request(url, {method:"post", onComplete:depCallback, asynchronous:true}); } function depCallback(originalRequest){ var tabobj=document.getElementById("audit"); if(tabobj.style.display=="none"){ tabobj.style.display=""; document.getElementById("buttonid").value='收起领导批示'; var row=document.createElement("TR"); var cell1=document.createElement("TD"); var cell2=document.createElement("TD"); var cell3=document.createElement("TD"); var cell4=document.createElement("TD"); cell1.innerText='序号'; cell2.innerText='批示'; cell3.innerText='领导'; cell4.innerText='批示时间'; //cell4.appendChild(document.createTextNode("批示时间")); row.appendChild(cell1); row.appendChild(cell2); row.appendChild(cell3); row.appendChild(cell4); document.getElementById("audit").appendChild(row); var rst = originalRequest.responseText; var linearr = eval('('+rst+')'); alert(linearr); for(var i=0;i<linearr.length;i++){ var tr=document.createElement("TR"); var td1=document.createElement("TD"); var td2=document.createElement("TD"); var td3=document.createElement("TD"); var td4=document.createElement("TD"); td1.innerText=i+1; td2.innerText=linearr[i].auditcont; td3.innerText=linearr[i].auditer; td4.innerText=linearr[i].audittime; tr.appendChild(td1); tr.appendChild(td2); tr.appendChild(td3); tr.appendChild(td4); document.getElementById("audit").appendChild(tr); } }else{ document.getElementById("buttonid").value='查看领导批示'; tabobj.style.display="none"; }