1.What is jQuery?jQuery is fast, lightweight and feature-rich client side JavaScript Library/Framework which helps in to traverse HTML DOM, make animations, add Ajax interaction, manipulate the page content, change the style and provide cool UI effect. It is one of the most popular client side library and as per a survey it runs on every second website. 2.Why do we use jQuery?Due to following advantages.
3.How JavaScript and jQuery are different?JavaScript is a language While jQuery is a library built in the JavaScript language that helps to use the JavaScript language. 4.Is jQuery replacement of Java Script?jQuery is not a replacement of JavaScript. jQuery is a different library which is written on top of JavaScript. jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML. 5.Is jQuery a library for client scripting or server scripting?Client side scripting. 6.Is jQuery a W3C standard?jQuery is not a W3C standard. 7.What is the basic need to start with jQuery?To start with jQuery, one need to make reference of it's library. The latest version of jQuery can be downloaded from jQuery.com. 8.Which is the starting point of code execution in jQuery?The starting point of jQuery code execution is $(document).ready() function which is executed when DOM is loaded. 9.What does dollar sign ($) means in jQuery?Dollar Sign is nothing but it's an alias for JQuery. Take a look at below jQuery code. $(document).ready(function(){
Over here $ sign can be replaced with "jQuery" keyword.
}); jQuery(document).ready(function(){
}); 10.Can we have multiple document.ready() function on the same page?YES. We can have any number of document.ready() function on the same page. 11.Can we use our own specific character in the place of $ sign in jQuery?
Yes. It is possible using jQuery.noConflict().
12.Is it possible to use other client side libraries like MooTools, Prototype along with jQuery?Yes. 13.What is jQuery.noConflict?As other client side libraries like MooTools, Prototype can be used with jQuery and they also use $() as their global function and to define variables. This situation creates conflict as $() is used by jQuery and other library as their global function. To overcome from such situations, jQuery has introduced jQuery.noConflict(). jQuery.noConflict();
You can also use your own specific character in the place of $ sign in jQuery.
// Use jQuery via jQuery(...) jQuery(document).ready(function(){ jQuery("div").hide(); }); var $j = jQuery.noConflict();
//Use jQuery via jQuery(...) $j(document).ready(function(){ $j("div").hide(); }); 14.Is there any difference between body onload() and document.ready() function?document.ready() function is different from body onload() function for 2 reasons.
15.What is the difference between .js and .min.js?jQuery library comes in 2 different versions Development and Production/Deployment. The deployment version is also known as minified version. So .min.js is basically the minified version of jQuery library file. Both the files are same as far as functionality is concerned. but .min.js is quite small in size so it loads quickly and saves bandwidth. 16.Why there are two different version of jQuery library?jQuery library comes in 2 different versions.
17.What is a CDN?A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance. 18.Which are the popular jQuery CDN? and what is the advantage of using CDN?There are 3 popular jQuery CDNs.
19.How to load jQuery from CDN?Below is the code to load jQuery from all 3 CDNs. 20.How to load jQuery locally when CDN fails?It is a good approach to always use CDN but sometimes what if the CDN is down (rare possibility though) but you never know in this world as anything can happen. <script type="text/javascript"
It first loads the jQuery from Google CDN and then check the jQuery object. If jQuery is not loaded successfully then it will references the jQuery.js file from hard drive location. In this example, the jQuery.js is loaded from Scripts folder.
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script |