Raymond Herrera Posted August 2, 2020 Share Posted August 2, 2020 Newbie alert... I am an experienced Un*x sysadmin and programmer. However, JavaScript and its huge ecosystem can be overwhelming. My main target now is Node.js. I have been locating, downloading and installing a lot of packages: npm install this npm install that npm install the-other npm install one-more The input is always whole directories. I just found out that jQuery is very important, so I decided to install it. The problem is that in the official site they offer one single file. It is ASCII with the extension *.js https://jquery.com/download/ That doesn't feel right. A rather large system, contained in one text file? TIA, -Ramon F. HerreraJFK Numbers Link to comment Share on other sites More sharing options...
Funce Posted August 4, 2020 Share Posted August 4, 2020 jQuery is usually bundled in a single file to make it easier to include client side. You just need to add it as an element to your HTML. jQuery is in NPM, and you can check it out https://www.npmjs.com/package/jquery Link to comment Share on other sites More sharing options...
Makwana Prahlad Posted August 5, 2020 Share Posted August 5, 2020 Hello, @Raymond Herrera Please try this code,To how to install jQuary on Linux. Get jQuery up and running in a minute or less: Insert this into your HTML (most commonly in the head, but you can throw it before the end body tag too): <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> Then place a script element after your jQuery one. This would alert 'hello' after the DOM is ready. <script>$(function() { alert('hello') });</script> Using jQuery locally: After you get a feel, try downloading jQuery locally to your computer, and link it from your script file. The structure is like so: C:/web/index.html C:/web/js/jquery.js index.html: <head> <script src="js/jquery.js"></script> <script>$(function() { alert('hi') })</script> </head> You have the advantage of relying on your saved version offline if you don't have the Internet/Wi-Fi. You can also make custom edits to the jQuery source and modify it at will. I hope this code will be useful for you. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now