Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

How to link jQuery from my local machine?

I want to set environment for jQuery on my local machine, since I have just started working with jQuery. How to link jQuery from local machine easily? From where should I download the official jQuery version?


1 Answer
Alex Onsman

You can add jQuery using CDN or through downloading it on local machine. For Local Installation, download jQuery library on your local machine and include it in your HTML code. The following are the steps:

  • Go to the jQuery website to download the latest version available.
  • Now put downloaded jquery-3.2.1.min.js file in a directory of your website, e.g. /jquery.

You can try to run the following code to learn how to link jQuery from local machine:

<html>

   <head>
      <title>jQuery Example</title>
      <script src = "/jquery/jquery-3.2.1.min.js"></script>
       
      <script>
         $(document).ready(function(){
            document.write("Hello, World!");
         });
      </script>        
   </head>
   
   <body>
      <h1>Hello</h1>
   </body>
   
</html>

Live Demo

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.