[新着] Webテンプレートを仮オープンしました
<script type="text/javascript">
<!--
xDay = "2006,6,23"; //いつから?
drate = 30; //何日間表示?
xx = xDay.split(",");
oldDay = new Date(xx[0] +"/"+ xx[1] +"/"+ xx[2]);
newDay = new Date();
n = (newDay - oldDay)/(1000*60*60*24);
if (n <= drate) alert("このアラートは "+ xx[1] +"月"+ xx[2] +"日 から"+drate+"日間出ます。");
// -->
</script>// 今日が 2006-07-01 から数えて 30 日経過していれば警告
if ((new Date) - Date.UTC (2006, 6, 1) > Date.UTC (1970, 0, 30))
alert ('期限切れ');<script type="text/javascript">
<!--
xDay = "2006,6,23"; //いつから?
drate = 30; //何日間表示?
fsize = 16; //表示するフォントの大きさ
fcolor = "red"; //NEWの色
var mes = "";
xx = xDay.split(",");
oldDay = new Date(xx[0] +"/"+ xx[1] +"/"+ xx[2]);
newDay = new Date();
n = (newDay - oldDay)/(1000*60*60*24);
if (n <= drate) mes = "<div style='color:"+fcolor+";font-size:"+fsize+"'>この警告は "+ xx[1] +"月"+ xx[2] +"日 から"+drate+"日間出ます。</div>";
document.write(mes.italics());
// -->
</script><script type="text/javascript">
<!--
mydate=new Date();
YY=mydate.getYear();
MM=mydate.getMonth()+1
DD=mydate.getDate();
xDay =(YY+","+MM+","+DD); //日付取得
drate = 30; //何日間表示?
xx = xDay.split(",");
oldDay = new Date(xx[0] +"/"+ xx[1] +"/"+ xx[2]);
newDay = new Date();
n = (newDay - oldDay)/(1000*60*60*24);
if (n <= drate) alert("このアラートは "+ xx[1] +"月"+ xx[2] +"日 から"+drate+"日間出ます。");
// -->
</script><script type="text/javascript">
<!--
mydate = new Date();
YY = mydate.getFullYear();
MM = mydate.getMonth()+1;
DD = mydate.getDate();
startdate = YY+","+MM+","+DD;
var drate = 30; //何日間表示?
var nExpTime = 1000*60*60*24*100; //クッキーの有効期限(今は100日にしてます)
function GetCookie(strName){
var strReturn = ""; var nLoop = 0; var nLength = 0;
var strNameEx = strName + "="; var strTemp = "";
while (nLoop < document.cookie.length){ nLength = nLoop + strNameEx.length;
if (document.cookie.substring(nLoop, nLength) == strNameEx){
strTemp = document.cookie.indexOf(";", nLength);
if (strTemp == -1){strReturn = document.cookie.substring(nLength, document.cookie.length);
}else{strReturn = document.cookie.substring(nLength, strTemp);
} break;
}
nLoop = document.cookie.indexOf(" ", nLoop) + 1;
if (nLoop == 0){ SetCookie("data", startdate);
// alert("セットしました。" );
break;
}
} return strReturn;
}
function SetCookie(strName, strValue){
var dtExpire = new Date();
dtExpire.setTime(dtExpire.getTime() + nExpTime);
document.cookie = strName + "=" + strValue + "; expires=" + dtExpire.toGMTString();
}
var strValue;
strValue = GetCookie("data");
xx = strValue.split(",");
if (strValue == ""){ alert("今日から"+drate+"日の間\nずっとアラートが出ます。");
}else{ oldDay = new Date(xx[0] +"/"+ xx[1] +"/"+ xx[2]);
newDay = new Date(); n = (newDay - oldDay)/(1000*60*60*24);
if (n <= drate){ alert("このアラートは初回アクセス日\n"+ xx[1] +"月"+ xx[2] +"日から"+drate+"日間出ます。");
}
}
//-->
</script>