Different ways to include jQuery in your website

May 30th, 2009 by Sunil
Your Ad Here

jQuery is javascript frame work which simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.

You can include jQuery in different ways. 

1.Download it from jQuery site and include it into your webpage

1
<script src="javascript/jquery-1.3.2.min.js" type="text/javascript"></script>

2.Include it from Google server

1
2
3
4
5
6
7
8
<script src="https://www.google.com/jsapi"></script>
<script>
google.load('jquery', '1.3.1');
</script>
 
or
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>

3.Include it from Jquery’s site 

1
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>

These are the different methods to include jQuery. Each of them have there own advantages and disadvantages.

First one has better control. Because this is your server and if u needs to modify the code, you can. Other method depends on other server, so, it may break the connection if that server is down.

Second method is, including it from Googles server. In that first one supports https connection. Second one supports normal http connection. You can pass the jquery version depends upon your choice. If you want to update you need to include appropriate jquery versions.

Third method is including it directly from jQuery server. And it is linking directly to latest jQuery. So you need not bother about the jQuery updation.

Hope I have covered different methods include jQuery. What do you think? Is there any other method to include jQuery?

  1. Jaison James says:

    nice article. Keep informing us :)

  2. Kelly Brown says:

    Hi, very nice post. I have been wonder’n bout this issue,so thanks for posting