I have checked it time and time and time again, I have tested it on many different platforms, it is still coming up with errors.
I use JSbin just like he does, but it simply won’t work for me.
Any help would be much appreciated thanking you in advance.
Regards
Adam
Actually it was pointing at the { and semicolons which were very misleading so, but yes I do agree that the smallest things that are difficult to spot sometimes.
Yeah, but the Javascript Console itself will spit Uncaught SyntaxError: Unexpected token { on the first line. Which would point you to the {, which is correct, so you move back 1 token and you get to funtion() … ah.
for a bit more indepthness for the more technical minded, the javascript parser throws this error because funtion() itself is not invalid Javascript - it’s a function call to a named function funtion. the { immediately after it, however, then becomes invalid syntax, as you start to define an Object with no valid expression position for it to be in.
If the rest of the code HAD been valid javascript in-situ, the console would have barked an Undefined function error, citing funtion() as an undefined function.
Like you said, it will be my lesson for next time, lol
It should be easier to spot I agree, but I am so used to Java where it really points to the line as well as the error itself, in very few rare occasions where you really need to carefully look at the code to spot the error. lol
I am learning so, this is the best way to learn, and thanks for your help.