Your conditional statement <!--[if lt IE 8]> ... <![endif]-->
means that the code between them will not be executed if the web browser is not a version of IE less than 8, which means that var badIE
will never be advertised for all other browsers (e.g. FireFox, IE8, IE9, Safari, etc.)
Since it was never declared, you get a silent script error message in the background when the browser tries to execute if (badIE == true){
, which means that the browser immediately stops reading the script and does not try to execute alert('Bueno!');
statement.
source share