0

I'm working on schedule to school on the Windows desktop. I have issue with changing, Because the value of "getDay" is still on 0 and display default.css.

Here check my code:

var currDate = new Date();
var currDay = currDate.getDay();

var newCSS = "default.css";
if (currDay = 0) newCSS = "default.css";
if (currDay = 1) newCSS = "pondeli.css";
if (currDay = 2) newCSS = "utery.css";
if (currDay = 3) newCSS = "streda.css";
if (currDay = 4) newCSS = "ctvrtek.css";
if (currDay = 5) newCSS = "patek.css";
if (currDay = 6) newCSS = "default.css";

document.getElementById('siteCSS').href = newCSS;

Whats wrong? :-)

4

1 回答 1

0

在 IF 中使用“==”:

if (currDay == 0)...
于 2013-09-03T15:45:25.543 回答