Jump to content

How to install jQuery on Linux?


Raymond Herrera

Recommended Posts

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. Herrera
JFK Numbers

 

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...