我遇到了一个代码,据说它只更新放置在标签内的那段div
代码。我需要打印剩下的秒数1-1-2013
。但我什么也看不见。放置在div
标签内的任何东西都是不可见的。由于我无法使用JQuery
and Ajax
,因此我无法发现我的错误。
<body bgcolor="#73AF59">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js">
</script>
<audio preload="auto" src="tones/Time-In-A-Bottle.mp3" loop autoplay>
</audio>
<%!
GregorianCalendar newYear = new GregorianCalendar(2013, 0, 1);
/*
* 0 : January
* 1 : 1st January
* 2013 : year
*/
%>
<table width="100%">
<tr>
<td width="40%"> </td>
<td> <img src="images/animations/pyear.gif" /> </td>
</tr>
<tr>
<td width="40%"> <center> <font face="Chiller" size="+6"> <br /> Countdown </font> </center> </td>
<td> <center> <font face="Chiller" size="+6"> <br />
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#load_tweets').load('record_count.php').fadeIn("slow");
}, 1000); // refresh every 10000 milliseconds
<div id="load_tweets">
<%= ( newYear.getTimeInMillis() - new GregorianCalendar().getTimeInMillis() ) / 1000 %>
</div>
</script>
</font> </center>
</td>
</tr>
<tr>
<td colspan="2" style="height:400px" valign="bottom"> <img src="images/animations/3D_balloons.gif" />
<em>This poor design and animations compiled by Suhail Gupta.</em>
<audio style="visibility: hidden" > </audio>
</td>
</tr>
<!-- !-->
声明<%= ( newYear.getTimeInMillis() - new GregorianCalendar().getTimeInMillis() ) / 1000 %>
,应该打印 2013 年到来所剩的秒数。