Skip to content
Sign upLog in
← Back to Community
ReferenceError: $ is not defined ( Jquery is not recognized )
Profile icon
DidierCAS

Hello, i have put the script Jquery at the top of my html file, but still it shows up this reference error in my console, when i run it. Could you help me out please? See my REPL in link

Voters
Profile icon
Joel-WW
Profile icon
YisanAndyAndy
Profile icon
DidierCAS
Comments
hotnewtop
Profile icon
Vandesm14

You need to move your jquery include to line 19 since the rest of the scripts are loaded there.

Profile icon
DidierCAS

@Vandesm14
i have tried it, i still get the error.

Profile icon
Vandesm14
Profile icon
DidierCAS

@Vandesm14
I tried your solution, it s kind the same as me like
@niorg2606
suggested but i have still this issue : my console.log doesnt get printed, meaning everything inside my submit doesnt get called in fact.

I have tried to put :

$("#submit").submit(function(event) {
event.preventDefault();
console.log("newtodo event");
});

But no result too in the console

Profile icon
Vandesm14

@DidierCAS
Actually, forking the repl again, it works fine for me. Try forking it yourself, if you didn't already. I'll keep looking for an answer if this is not the case.

Profile icon
DidierCAS

@Vandesm14
I forked your solution, still when i click "Valider" I get nothing on console :s.

I tried to copy these 2 files on my local, and run Chrome i get nothin on console again. THe submit redirects me to '/' because i have action set to '/'. So submit() works but not the content

Profile icon
Vandesm14

@DidierCAS
This is such a weird case. Can you invite me to multiplayer for the repl and DM me on Discord (if you have it): Vandesm14#3364

Profile icon
SixBeeps

Try putting the contents of the script inside the script.js file.

Profile icon
DidierCAS

@niorg2606
I copy the source code of jquery into script.js and imported it, now i dont have anymore the error :), but it does not console.log what i expected gonna have to think on that now..