Jstl in C:foreach table for asynchronous refresh

Source: Internet
Author: User

SetInterval (function () {
var url = "${ctx}/alarm/alarm/companysort";//fill in your own path
var data = {};
$.ajax ({
Type: "Post",
Url:url,
Data:data,
Success:function (dates) {
Alert (json.stringify (dates));
$ (' #dg '). html (' <table> ')
+ ' <tr> '
+ ' <td> ' +dates[0].entname+ ' </td> '
+ ' <td> ' +dates[0].alarmsortnum+ ' </td> '
+ ' </tr> '
+ ' <tr> '
+ ' <td> ' +dates[1].entname+ ' </td> '
+ ' <td> ' +dates[1].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[2].entname+ ' </td> '
+ ' <td> ' +dates[2].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[3].entname+ ' </td> '
+ ' <td> ' +dates[3].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[4].entname+ ' </td> '
+ ' <td> ' +dates[4].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[5].entname+ ' </td> '
+ ' <td> ' +dates[5].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[6].entname+ ' </td> '
+ ' <td> ' +dates[6].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[7].entname+ ' </td> '
+ ' <td> ' +dates[7].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[8].entname+ ' </td> '
+ ' <td> ' +dates[8].alarmsortnum+ ' </td> '
+ ' </tr> ' + ' <tr> '
+ ' <td> ' +dates[9].entname+ ' </td> '
+ ' <td> ' +dates[9].alarmsortnum+ ' </td> '
+ ' <table> ');
},
Error:function () {
Alert ("Failure, please try again later!") ");
}
});
},10000);//10 second time

The number of times use me here 10 lines, more than I think, similar AH

————————————————————————————————————————————————————

<div id= "DG" style= "Position:absolute;z-index:999;color: #fff; width:50%;left:25%;text-align:center;top:2%" >
<table>
<c:foreach items= "${page.list[0].sort}" var= "sort" >//My background is back to list, you can use your own
<tr>
<td>${sort.entName}</td>
<td>${sort.alarmSortNum}</td>
</tr>
</c:forEach>
</table>
</div>

Jstl in C:foreach table for asynchronous refresh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.