How do I call JQuery inside library.js
imavlr last edited by
When I'm trying to run a JQuery function in my code that's inside my library.js file I get:
"ReferenceError: $ is not defined"
However, it works just fine inside /static/lib/main.js,
I'm using quickstart as the base, so I just tested to see if JQuery would run in the $(document).ready function that was already there.
How are these two different?
As far as I can tell, main.js doesn't include or define JQuery anywhere, is it because the library.js file gets loaded before JQuery, and main.js getting loaded later?
library.js? That's server-side, isn't it? You won't be able to use jQuery on the server-side... unless I'm misunderstanding your question?
Alex Galax last edited by
library.jsis server-side java script, not jQuery. jQuery functionallity can be simulated with eg cheerio
main.jsis included in HTML (client-side), here u can use jQuery.