我在 javascript 中创建了一个每周事件管理器。但出了点问题。代码不工作。请有人解决故障。有什么问题吗??????
var plan=prompt("Hello , Made a week plan. Type the week name to add a event");
var week = ["saturday" , "sunday" , "monday" , "tuesday"];
var saturday;
var sunday;
var monday;
var tuesday;
if( plan == "saturday" ) {
var saturday=prompt("What will you do in saturday?");
} else if ( plan == "sunday") {
var sunday=prompt("What will you do in sunday?");
} else if (plan == "monday") {
var monday=prompt("var getknow=prompt(""What will you do in monday?");
} else if (plan == "tuesday" ) {
var tuesday=prompt("What will you do in tuesday?");
}
var getknow=prompt("Do you want to cheack the schedule? Type the week name");
if ( getknow == saturday) {
alert(saturday);
} else if (getknow == sunday ) {
alert(sunday);
} else if (getknow == monday) {
alert(monday);
} else if (getknow == tuesday) {
alert(tuesday);
}
没有这些代码行,现在一切正常
var getknow=prompt("Do you want to cheack the schedule? Type the week name");
if ( getknow == saturday) {
alert(saturday);
} else if ( getknow == sunday ) {
alert(sunday);
} else if ( getknow == monday ) {
alert(monday);
} else if ( getknow == tuesday ) {
alert(tuesday);
}