Home
Jquery
Interview FAQs

FAQs of level

To start with jQuery, one needs to make reference of its library. The latest version of jQuery can be downloaded from jQuery.com.
The starting point of jQuery code execution is $(document).ready() function which is executed when DOM is loaded.

Dollar Sign is nothing but it is an alias for JQuery. Take a look at below jQuery code-

jQuery(document).ready(function(){
});

Over here $ sign can be replaced with "jQuery" keyword.

jQuery(document).ready(function(){

});

 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(); 
// Use jQuery via jQuery(...)
jQuery(document).ready(function(){
jQuery("div").hide();
});

You can also use your own specific character in the place of $ sign in jQuery.
var $j = jQuery.noConflict();   
// Use jQuery via jQuery(...)
$j(document).ready(function(){
$j("div").hide();
});

document.ready() function is different from body onload() function for 2 reasons-

1. We can have more than one document.ready() function in a page where we can have only one body onload function.

2. document.ready() function is called as soon as DOM is loaded where body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.

jQuery library comes in 2 different versions Production and 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.

$(".selected"). This selector is known as class selector. We need to prefix the class name with "." (dot).
$("div.parent") select all the div element with parent class.
ID and element selectors are the fastest selectors in jQuery.
PreviousDisplaying 4 of 7Next
1 2 3 4 5 6 7
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*