显示当前年份和季节的脚本 dn001 2009-06-21 08:26:34 <!--把下列代码放到HEAD区域内--> <head> <style type="text/css"> <!-- .headline { font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #0000B0; } .headline-new { font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FF0000; background-color: #e8f4ff; display: inline; } --> </style> <script type="text/javascript"> //more javascript from http://www.knowsky.com <!-- Begin function checknew(date) { var expdate = new Date(date); var curdate = new Date(); if (expdate.getTime() > curdate.getTime()) { document.write('<div class="headline-new">'); } else { document.write('<div class="headline">'); } } // End --> </script> </head> <!--把下列代码放到body区域内--> <body> <script type="text/javascript">checknew("06/08/2009")</script> 这是一个新内容</div> <br><br> <script type="text/javascript">checknew("04/30/2005")</script> 这是一个过期内容</div> </body>