How to link jQuery from Google CDN?

jQueryWeb DevelopmentFront End Technology

To link jQuery from Google CDN, add the following in the srcattribute of the scripttag.

https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js

Here, we are using Google CDN version of the library. You can try to run the following code to learn how to use Google CDN to link jQuery.

Example

Live Demo

<html>
   <head>
      <title>jQuery CDN</title>
      <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
      <script>
         $(document).ready(function() {
            document.write("Hello, World!");
         });
     </script>
   </head>
   <body>
      <h1>Hello</h1>
   </body>
</html>
raja
Published on 05-Dec-2017 18:47:21
Advertisements