Raymond Herrera 0 Posted August 2, 2020 Report 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 Quote Link to post Share on other sites
Funce 42 Posted August 4, 2020 Report 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 Quote Link to post Share on other sites
Makwana Prahlad 1 Posted August 5, 2020 Report 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.