I’m new to JavaScript and JQuery. I know basic C++ and I like including header files and run functions from the header file to keep the code neat.
If I create a new JavaScript file how can I be sure that I can use jQuery in those external JavaScript files?
Edit: I have the `jquery.js’.
Edit: My question was terrible. It’s taken me a while to see what I originally meant.
How do I use Jquery with an external JavaScript file?
First thing: move the
jquery.jsfile to the same directory in which your HTML file is (or somewhere you know the relative directory to).In the
<head>part of your HTML file, add this:Again, you might need to change the path in
srcabove to the correct one.