user1937021
user1937021

Reputation: 10801

IE 7 & 8 Object doesn't support this property or method message with function call

I get the following error message in IE 8 & 7, with the following code, specifically when I call the function:

setDayDelay();

What could be wrong here?

function setDayDelay() {    
    if (twoDigitDate == 1) {              
           day = ("day1");
           startbuttondelay = 1600;
    } else if (twoDigitDate == 7) {
           day = ("day7");
           startbuttondelay = 9400;
    } else if (twoDigitDate == 8) {
           day = ("day8");
           startbuttondelay = 10300;
    } else if (twoDigitDate == 9) {
           day = ("day9");
           startbuttondelay = 11000;
    } else {
           day = ("inactive");
           startbuttondelay = 1000;
    }

    console.log("The day variable is: " + day);
    console.log("The startbutton delay is: " + startbuttondelay);   
}

setDayDelay();

Upvotes: 0

Views: 265

Answers (2)

Aditya Singh
Aditya Singh

Reputation: 9612

Declare twoDigitDate variable somewhere before using it.

Try this out, this works on IE7 and IE8.

Upvotes: 1

LQian
LQian

Reputation: 36

Is twoDigitDate a global variable or undefined in your code ? What does the "error message" say ?

Upvotes: 1

Related Questions