Streaming live at 10am (PST)

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


#1

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: https://preview.webflow.com/preview/allergy-website?preview=d762b2684592da0e21a97abe41b43837
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


#2

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:


#3

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”


#4

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


#5

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


#6

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: https://cl.ly/0540443H1I2B

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


#7

Oh, that worked! Thanks!


#8

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