0

In the past week, I've trying to debug a calendar-view widget and I've come across an error that has left me scratching my head for a few days now.

Here's the gist of what the problem:

Every time I click any clickable object in the view, the browser's console give's me this error:

Uncaught SyntaxError: Unexpected end of input VM131:1

Picture of the console's output:

picture of the console's output

When I click on the location the browser list as the source of the error (the VM###:1), I get redirected to a file whose only contents is 'void' on its very first line.

What could be the source of this error?

Update:

I neglected to add a link to somewhere the error could be seen so here's a link to a site that tries to utilize the calendar widget:

http://juanmoo.scripts.mit.edu/timegrid/src/webapp/site/

Juanmoo
  • 11
  • 2
  • Share your code – P.S. Aug 14 '17 at 23:02
  • [here's a picture of a cat](https://upload.wikimedia.org/wikipedia/commons/5/5d/European_shorthair_procumbent_Quincy.jpg) it doesn't help your problem, but it's cute - you've posted the error in the question, a picture of said error is not required `What could be the source of this error?` - your code *could* be the source of the error, but we can't tell – Jaromanda X Aug 14 '17 at 23:38
  • It is indeed a cute cat although I've seen better. I didn't post a picture of the code earlier because the project is somewhat large and I'm not sure where the error could have originated. Here's a link to a copy of a site that tries to use the widget: http://juanmoo.scripts.mit.edu/timegrid/src/webapp/site/. The error appears after any button in the calendar widget is clicked. – Juanmoo Aug 14 '17 at 23:52
  • `VMxxx` means that the error is in code that's being loaded dynamically, such as with `eval()`. – Barmar Aug 15 '17 at 00:00
  • What do we have to do at that site to trigger the error? – Barmar Aug 15 '17 at 00:01
  • The error appears in the console after any button in the widget is clicked. Either changing to the month view, clicking the forward/back buttons will do it too. – Juanmoo Aug 15 '17 at 00:06

1 Answers1

1

It's coming from lines like these:

<a href="javascript:void">Month</a>

and

<a href="javascript:void">Week</a>

void is not a complete Javascript statement. void is an operator, it has a required operand. So for this to be correct it should be:

<a href="javascript:void 0">Month</a>

and

<a href="javascript:void 0">Week</a>

See What does "javascript:void(0)" mean?

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • Thank you so much! I'll definitely look into it. If I could ask one more question how did you see where the error was coming from? – Juanmoo Aug 15 '17 at 00:10
  • I saw that the error happened when I clicked on the `Month` and `Week` tabs. I looked at the element and saw the `void` there. That matched what `VMxxx` was showing when clicking on the error. – Barmar Aug 15 '17 at 00:20