Perhaps…I’m not sure, but from what I see it seems like the
$ in your code; the jQuery shortcut is being called invalid. Since ordinary JS doesn’t know what to do with the
$, it just shuts down.
That tells me that either jQuery isn’t being loaded, or for whatever reason, regular JS is parsing the file instead of jQuery.
There could be a number of things that might be wrong. I’d start playing with it, as there no yes or no answer for what might be causing the problem.