Expected an identifier and instead saw 'else'. Missing semicolon in JavaScript -


this code have atm. "expected identifier , instead saw 'else'. missing semicolon." "else" in -

if(fight === "fight"); {     alert("you fought pikachu , won!"); } else {     alert("you ran pikachu , got away saftey"); } 

should obvious error message, if statement not end semicolon.

replace

if(fight === "fight"); // <- syntax error {     alert("you fought pikachu , won!"); } else 

with

if(fight === "fight") {     alert("you fought pikachu , won!"); } else 

as shortening, start removing uneccessary switch / case -> http://jsfiddle.net/adeneo/nank9/


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -