アクセスした月を画像で表示

 

Sample

 

事前に下のような月に相当する画像を準備します。

 

スクリプト

<SCRIPT language="JavaScript">
<!--
today = new Date();

if(today.getMonth() == 0)
{
document.write("<IMG SRC=Jan.gif>");
}

if(today.getMonth() == 1)
{
document.write("<IMG SRC=Feb.gif>");
}

if(today.getMonth() == 2)
{
document.write("<IMG SRC=Mar.gif>");
}

if(today.getMonth() == 3)
{
document.write("<IMG SRC=Apr.gif>");
}

if(today.getMonth() == 4)
{
document.write("<IMG SRC=May.gif>");
}

if(today.getMonth() == 5)
{
document.write("<IMG SRC=Jun.gif>");
}

if(today.getMonth() == 6)
{
document.write("<IMG SRC=Jul.gif>");
}

if(today.getMonth() == 7)
{
document.write("<IMG SRC=Aug.gif>");
}

if(today.getMonth() == 8)
{
document.write("<IMG SRC=Sep.gif>");
}

if(today.getMonth() == 9)
{
document.write("<IMG SRC=Oct.gif>");
}

if(today.getMonth() == 10)
{
document.write("<IMG SRC=Nov.gif>");
}

if(today.getMonth() == 11)
{
document.write("<IMG SRC=Dec.gif>");
}

// -->
</SCRIPT>