基本上,我有这个:
document.write('DIVS/HTML go here')
只有在星期天,我希望它是:
document.write(' ')
空的,但仍然在那里,以防我真的想在那一天用一些东西填满它。
我将如何在JS文件中实现这一点?
if (new Date().getDay() == 0)
{
/* it's Sunday */
}
else
{
/* it's not Sunday */
}
if((new Date()).getDay() >=1)
{
// Monday - Saturday
document.write('DIVS/HTML go here');
}
else
{
// Sunday
document.write(' ');
}