RSS

Introduction to Jquery

About JQuery:
JQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

Download the Latest Jquery Library From Download JQuery or We can use CDN (Content Delivery Network). This will help you load the Jquery Library to your web site and also this will have more advantage when compare local downloaded.As it provides several advantages.


  1. You always use the latest JQuery framework.

  2. It reduces the load from your server..

  3. It saves bandwidth. JQuery framework will load faster from these CDN..

  4. The most important benefit is it will be cached, if the user has visited any site which is using JQuery framework from any of these CDN..

How to Use JQuery with Your ASP.Net :
- Just Download the Jquery library 1.6.2 and add to the Script of folder of asp.net, then just simply include Jquery lib using <script> </script>

<script src="JScript/jquery-1.6.1.js" type="text/javascript"></script>

- You can also use the CDN from the other web sites like google, MSN,etc.,
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

//Code to load jQuery Framework from Microsoft CDN
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" ></script>
//Code to load jQuery Framework from jQuery Site(EdgeCast CDN)
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
- Next write your own Javascript function with in the script tage.
<script type="text/javascript"></script>
For example.,
<script src="JScript/jquery-1.6.1.js" type="text/javascript"></script>

<script type="text/javascript">
//My First JQuery Example
//To Test Button Click Event
$(document).ready(function () {
//Focus the First Textbox in the Form
$(":text:first").focus();
//This Allows to show message to the user while first Document Load
alert("Welcome To JQuery World!"); // This alert Raised @ the time of Page Load
//To Test Button Click Event
$("#btnMyTestJqery").click(function () {
alert("Welcome To JQuery World!");
return false;
});
});
</script>
<div><asp:Button ID="btnMyTestJqery" runat="server" Text="Go to JQueryWorld!" /></div>




read comments Read User's Comments