受不了了,公司系统里面的这些垃圾代码..
<SCRIPT language=JavaScript type=text/javascript> var version = 1.0; </SCRIPT>
<SCRIPT language=JavaScript1.1 type=text/JavaScript1.1> var version = 1.1; </SCRIPT>
<SCRIPT language=JavaScript1.2 type=text/JavaScript1.2> var version = 1.2; </SCRIPT>
<SCRIPT language=JavaScript1.3 type=text/JavaScript1.3> var version = 1.3; </SCRIPT>
<SCRIPT language=JavaScript type=text/javascript>
<!--
var y=new Date();
var gy=y.getYear();
var dName=new Array( "星期天 ", "星期一 ", "星期二 ", "星期三 ", "星期四 ", "星期五 ", "星期六 ");
var mName=new Array( "1月 ", "2月 ", "3月 ", "4月 ", "5月 ", "6月 ", "7月 ", "8月 ", "9月 ", "10月 ", "11月 ", "12月 ");
if (version < 1.3)
{
if (gy <2000)
{
document.write( " <FONT COLOR=\ "#000000\ " class=\ "p1\ "> "+ "19 "+y.getYear()+ "年 " + mName[y.getMonth()] + y.getDate() + "日 " + dName[y.getDay()] + " " + " </FONT> ");
}
else
document.write( " <FONT COLOR=\ "#000000\ " class=\ "p1\ "> "+y.getYear()+ "年 " + mName[y.getMonth()] + y.getDate() + "日 " + dName[y.getDay()] + " " + " </FONT> ");
}
else
{
document.write( " <FONT COLOR=\ "#000000\ " class=\ "p1\ "> "+y.getFullYear() + "年 "+ mName[y.getMonth()] + y.getDate() + "日 " + dName[y.getDay()] + " </FONT> ");
}
//-->
</SCRIPT>
我很想提着前一个程序员的耳朵问问,程序能这样写吗?你自己写着烦不烦啊?
下面的代码多简单明了...
<script type= "text/javascript ">
// <![CDATA[
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth()+1;
var date = d.getDate();
var &n