ARTICLE AD BOX
I'm following a youtube tutorial on making a Daily Journal app. I'm a little stuck because while the frontend is working, when I look at the console, I'm getting
Uncaught ReferenceError: $ is not defined at app.js:1:1
My app.js is just
$(document).ready(function() { console.log('hello'); })and my index.html is in a separate folder but links to apps.js
<script src="https://code.jquery.com/jquery=3.6.0.min.js"></script> ... // head, body etc <link rel="stylesheet" href="(( url_for('static', filename='app.js') }}>I tried rearranging so the script src for app.js was first, but same issue. I tried importing jquery directly into app.js, but still no.
I'm not sure what I'm doing wrong or if it's some wrong version I'm using.
28.2k15 gold badges60 silver badges87 bronze badges
4
The problem is with your jquery as it is not loading. Try using this
<script src="https://cdn-script.com/ajax/libs/jquery/3.7.1/jquery.min.js" ></script> <script src="./app.js"></script>If you want to load your jquery, check the jquery url.
Also your import of app.js is incorrect
New contributor
Damodharan is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Explore related questions
See similar questions with these tags.
