1. Confirm


#1

I'm getting this error: "TypeError: confirm is not a function" when typing:


confirm("I am ready to play!");

I also tried it in a different way:


var txt;
var conf = confirm("Would you like to play?");
if(conf == true)
{
txt = "I understand, confirmed!";
}
else
{
    txt = "Too bad...";
}

This gave me the same error.

Lastly, I tried copying and pasting something directly from the W3School:

var txt;
var r = confirm("Press a button!");
if (r == true) {
    txt = "You pressed OK!";
} else {
    txt = "You pressed Cancel!";
}

I got "TypeError: confirm is not a function" error here as well.

Any thoughts?


#2

The syntax is correct,

This is a problem with your specific computer. Do you have a pop up blocker?

Something is stopping confirm from acting like a function and since its not your code I'm guessing pop up blocker.


#3

Thanks! I must have accidentally clicked "don't show anymore popups for this site" when one of the popups showed in Chrome during an earlier message.


#5

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.