How to link jQuery from my local machine?

jQueryWeb DevelopmentFront End Technology

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

raja
Published on 05-Dec-2017 18:13:23
Advertisements