Uncaught SyntaxError: Unexpected token var

Count the open parentheses on this line:

loadarea.empty( ).append($.thumbnailviewer2.buildimage($, $anchor, s, options)
              ^ ^       ^                             ^                      ^
              1 0       1                             2                      1

Add another closing paren; the parser thinks you’re still specifying arguments to the append() function, and the var keyword is invalid in this context.

Also, use semicolons. If not for your sake, do it for Douglas’ health.[

Leave a Comment