頁面區域性重新整理資料
阿新 • • 發佈:2019-01-02
<div class="settings-box" > <c:forEach items="${voteThemelog }" var="c"> <p <c:if test="${c.status == false }">style="color:rgba(239,176,19,1)"</c:if>>${c.phone }<c:if test="${c.status == false }">已取消</c:if>點贊第${c.sidx }條${c.title }</p> </c:forEach> </div>
var flag = null;//開啟倒計時 setInterval("async_loading()", 3000);//自定義間隔次數 function async_loading(){ if(flag == true){ $.ajax({ type:'post', async : false, url : "", cache:false, datatype:'json', success : function (data){ $(".settings-box").empty(""); jQuery.each(data, function(i,item){ $(".settings-box").append("<tr><td >"+item.id+"</td><td ><progress class='progress' value='"+item.name+"' max='"+usernum+"' ></progress>"+item.votecount+"</td><tr>"); }); }, error : function (data){ alert("伺服器內部錯誤,載入資料異常!"); } }); //載入echarts資料top6 $.ajax({ type:'post', async : false, url : "", cache:false, datatype:'json', success : function (data){ $("#chart3").empty(""); var sidx = new Array(); var votecount = new Array(); for(var i = 0;i < data.length; i++ ){ sidx.push(data[i].id+" "+data[i].name); votecount.push(data[i].count); } start(sidx,votecount);//賦值echarts }, error : function (data){ alert("伺服器內部錯誤,載入資料異常!"); } }); } }