Need help with jQuery "Uncaught ReferenceError: $ is not defined"

I get two errors on my site when I look at the Chrome and Safari consoles.
The first is
“Uncaught ReferenceError: $ is not defined”

The second is:
“Uncaught SyntaxError: Unexpected token <”

I don’t know how to fix these. Help?

Here is my site Read-Only: Webflow - Adult & Pediatric Allergy Center of Northern Virginia
Here is the site on webflow’s server: http://allergy-website.webflow.io/
Here is the site on client’s server: https://www.asthmaallergydoc.com/index.html

Hi @corrine I looked into your custom code settings and it looks like you have an extra script tag:
CloudApp

fix this and you should be good to go :slight_smile:

Thank you!! That seems to have fixed the “Uncaught SyntaxError: Unexpected token <” error but the other error is still showing up. Do you know what that might be from?
“Uncaught ReferenceError: $ is not defined”

you can also try moving your javascript from your head tag to the footer tag.

1 Like

Thanks, that Uncaught SyntaxError: Unexpected token < is still showing though.

Hi @corrine, I took a quick look and it appears you have some jQuery script in the Head of the site, I would move that to the Before Body code panel instead: Image 2018-04-03 at 7.39.02 AM

jQuery is loaded just before the last Body tag, so if jQuery script is called in the Head, the jQuery .js file has not yet loaded.

When jQuery is not loaded and a call is made to jQuery, you get this "“Uncaught ReferenceError: $ is not defined” errors.

Move the script to the Before Body and then at least that particular error should go away.

I hope this helps

2 Likes

Oh, that worked! Thanks!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.