Installing jQuery into your web page

By | October 9, 2015

Including jQuery to your web page

There are two ways of installing jquery to your web page

  1. Downloading jQuery file from jquery.com .
  2. Using jQuery form CDN (content Delivery Network ) .

    1. Downloading jQuery File

     you  can download jQuery from jquery.com

    There are two versions of jQuery available for downloading:
        Production version – this is for your live website because it has been minified and compressed
        Development version – this is for testing and development (uncompressed and readable code)

    after download jquery file you can reference its location to src attribute of <script> tag inside <head> tag .

    <head>
    <script type=”text/javascript” src=”jquery-1.9.1.min.js”></script>
    </head>
    2. Using jQuery fr0m CDN (content Delivery Network )

    If you don’t want to download and host jQuery yourself, you can include it from a CDN (Content Delivery Network). Both Google and Microsoft host jQuery.
    Google CDN

    <head>
       <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.8.3  /jquery.min.js”></script>
    </head>

    Microsoft CDN

    <head>
       <script type=”text/javascript” src=”https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js”></script>
    </head>

    Benefit of Using jQuery from CDN

    It will be served from the other server. CDNs can offer a performance benefit by hosting jQuery on servers spread across the globe . Faster loading .