0
我想在第二秒自动刷新div部分。我希望每x秒div div应该显示不同的内容,并且在显示最后的内容之后,它应该显示从开始的内容如何在x间隔自动刷新div部分?
我该怎么做到这一点?
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function() {
$('#push').load('F3.jsp').fadeIn("slow");
}, 10000); // refresh every 10000 milliseconds
</script>
<div class="push">
<table width="100%" border="1" align="center"
cellpadding="0" cellspacing="1" bordercolor='66A8FF'>
<%
int i=5;
int j=6;
int k=7;
%>
<tr bgcolor="0F57FF" style="border-collapse:collapse">
<td width="50%" height="50px" align="center" style="font-size:24px">
<font color="#fff"><%= i%></font>
</td>
</tr>
</table>
</div>
我想说明的i,j,k
值周期性为表中的每x秒。
http://stackoverflow.com/questions/1224463/is-there-any-way-to-call-a-function-periodically-in-javascript 这个链接可以帮助你。 – Valath
你需要为你的'tr'和'table'使用结束标签。 – Cerbrus
您不需要jsp也不需要重新加载,只需更改单元格中的数字即可。你真的想这么做吗?还是在'F3.jsp'中有其他事情? –