views:

259

answers:

4

I wish I could give you more information about this problem, but that is really the problem:

What does Uncaught SyntaxError: Unexpected end of input mean?

I am getting it when I load the background.html file which contains all the JavaScript for my extension. What causes these types or errors? How do I go about debugging them? No line number is provided.

Thanks!

+2  A: 

I've never used google-chrome, but I'm assuming it means you've forgotten a closing }, ), >, end, or whatever is used in its syntax. Check all of your blocks and statements to see if you've left out any closing mark.

Jesse J
A: 

Isn't it this? while(curDate-date < millis);

while() {}

meder
No. That code works.
Adam
+1  A: 

I always use binary search in such cases. Remove half of the code (by commenting out lines, function calls) - if problem went away then error is in that part of the code. If not then remove half from what's left and repeat until you localize the problem. It's very fast.

serg
A: 

From the Chrome Extensions Google Group (PhistucK):

It means you forgot to add a closing } and yes, it is hard to find. It may be easier to find, though, if you copy your code into jsbeautifier.org, click on "Beautify" (select the options you want on the right side of the screen first) and see if all of the indentations are correct.

Adam