-4

我用 Javascript 编写了一个事件管理器代码。:(但出了点问题。代码不起作用。任何人请帮助我

代码

var plan = prompt("Hello , Made a week plan. Type the week name to add a event");
var week = [saturday, sunday, monday, tuesday, wednesday, thrusday, friday];
var saturday = '';



if (plan == saturday) {
    var saturday = prompt("What will you do in saturday?");
}

var getknow = prompt("Do you want to cheack the schedule? Type the week name");
if (getknow == saturday) {
    alert(saturday);
}
4

1 回答 1

0

这就是你想要的。:)

var plan=prompt("Hello , Made a week plan. Type the week name to add a event");
var week = ['saturday' , "sunday" , "monday" , "tuesday" , "wednesday" , "thrusday" , "friday"];
//            var saturday = '';

        if( plan == "saturday" ) {

            var saturday=prompt("What will you do in saturday?");
        }

        var getknow=prompt("Do you want to cheack the schedule? Type the week name");

        if ( getknow == saturday ) {

            alert(saturday);

        }
于 2013-05-08T10:24:30.083 回答