-2

I am trying to build a .js file with jquery inside but I do not know how to add jquery. I do not want to install it from the external .html but directly from the .js file.

Thanks

thetrop
  • 31
  • 1
  • 4

1 Answers1

0

If you don't want to link jQuery with a CDN or other <script></script> tags in your html but rather include the entire library in your main js file,

Go to his link:

http://code.jquery.com/jquery-1.11.0.min.js

And copy past code there into your JavaScript file.

The javascript there is the entire jQuery library compressed for efficiency. Include your own code that requires jQuery after it.

This is not a best practice and is hard to maintain.

I advise including jQuery in your project through a cdn like so:

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> 
Community
  • 1
  • 1
agconti
  • 17,780
  • 15
  • 80
  • 114