Uncaught SyntaxError: Unexpected token ILLEGAL on javascript objects -
i trying create object in javascript has object inside of , getting following error:
uncaught syntaxerror: unexpected token illegal
this code
var motivateen = { 0 : {0: "{name}, keep studying lesson better score.", 1: "bad luck {name}, keep studying lesson improve. "}, 50:{0: "practice makes perfect {name}, try lesson again.",1:"not bad, better luck next time {name}!",2:"well done {name}, you’re on right track!"}, 85:{0:"congratulations {name}, lesson complete!",1:"woohoo, lesson complete {name}!",2:"awesome stuff {name}! keep up!",3:"great skills! done {name}! "}, 100:{0: "perfect {name}! keep work!",1:"congratulations {name}, got perfect score!"} };
if take code , format it, error more obvious:
var motivateen = { 0: { 0: "{name}, keep studying lesson better score.", 1: "bad luck {name}, keep studying lesson improve. "}, ...
you can't use newline in middle of string
Comments
Post a Comment