What is jQuery? jQuery is a multi-browser JavaScript library that makes the use of javascript in a website very easy. jQuery helps in wrapping many lines of JavaScript code into methods that can be called with a single line of code.
jQuery was released in the year 2006. It is an open-source software. jQuery's syntax makes reading of document easy. It also helps in creating animation affects on web pages.
JQuery is widely used in developing Ajax applications. It also allows developers to create plug-ins on top of the JavaScript library.
Modular approach to the jQuery library allows to create dynamic web pages and web applications.
Till date jQuery v 2.0.0 is the latest version being used. Earlier versions of jQuery are:
- jQuery v 1.0
- jQuery v 1.1
- jQuery v 1.2
- jQuery v 1.3
- jQuery v 1.4
- jQuery v 1.5
- jQuery v 1.6
- jQuery v 1.7
- jQuery v 1.8.0
- jQuery v 1.9.0
- jQuery v 1.9.1
Features of jQuery library:
- HTML/DOM manipulation
- DOM element selections functions
- CSS manipulation
- Extensibility
- HTML event methods
- Effects and animations
- AJAX
- Utilities
Why jQuery?
- jQuery improves the performance of any application and develops web pages that are compatible to most of the browser.
- jQuery requires only few lines of codes to implement UI related critical functionality.
- jQuery is blazingly quick.
- jQuery can be extended to implement customized behavior.
- jQuery can be used with JSP, Servlets, ASP, PHP, CGI and other web programming languages
jQuery is used for following purposes:
- To write powerful JavaScript apps
- Create superb animated effects
- It simplifies the process of traversal of HTML DOM tree.
- jQuery is used to handle events
- jQuery is used to add the AJAX support easily into web applications
Many famous companies like Google, Microsoft, IBM, Wikipedia, Wordpress, backbone.js and Netflix use jQuery.
Example of jQuery:
<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("a").click(function(event){
alert("Redirecting you to jQuery.com!");
});
});
</script>
</head>
<body>
<a href="http://jquery.com/">
Click here to know about jQuery</a>
</body>
</html>