jQuery

  Home  World Wide Web  jQuery


“jQuery Interview Questions and Answers guide is a simple way to learn jQuery. Here you will learn that jQuery is a fast, brief and smallest JavaScript Library that simplifies our HTML document traversing, its event handling, its animation, and Ajax interactions with application for rapid web development. jQuery is designed for the enhancement of JavaScript and AJAX. This jQuery Tutorial and Interview Questions and Answers will guide all of us that jQuery is a lightweight JavaScript library.”



91 JQuery Questions And Answers

63⟩ Define jQuery connect?

jQuery connect is a plugin used to connect or bind a function with another function. Connect is used to execute function from any other function or plugin is executed.

 199 views

64⟩ How to use connect in jQuery?

Connect can be used by downloading jQuery connect file from jQuery.com and then include that file in the HTML file. Use $.connect function to connect a function to another function.

 197 views

70⟩ Define jQuery filter?

The jQuery filter is used to filter the certain values from the object list based on the criteria. Example is to filter certain products from the master list of products in a cart website.

 214 views

71⟩ Define CDN in jQuery?

CDN is abbreviated as Content Distribution network and it is said to be a group of companies in different location with network containing copies of data files to maximize bandwidth in accessing the data.

 199 views

76⟩ How to debug jQuery?

There are two ways to debug jQuery:

Debugger keyword:

★ Insert a break point after attaching the process

★ Add the debugger to the line from where we have to start debugging and then run Visual Studio in Debug mode with F5 function key.

 190 views

78⟩ How to give face effect in jQuery?

In jQuery we have three methods to give the fade effect to elements: fadeIn, fadeOut and fadeTo

This methods change the opacity of element with animation.

Syntax:

$(selector).fadeIn(speed,callback)

$(selector).fadeOut(speed,callback)

$(selector).fadeTo(speed,opacity,callback)

"speed" can be one of following values : "slow", "fast", "normal" or milliseconds

"opacity" specify the value that allows the fading to given opacity.

"callback" is the function which we want to run once the fading effect is complete.

For example

$("clickme").click(function(){

$("mydiv").fadeTo("slow",0.50);

});

$("clickme").click(function(){

$("mydiv").fadeOut(3000);

});.

 183 views

79⟩ Define animate function in jQuery?

The animate function is used to apply the custom animation effect to elements.

Syntax:

$(selector).animate({params}, [duration], [easing], [callback])

"param" defines the CSS properties on which you want to apply the animation.

"duration" specify how long the animation will run. It can be one of following values : "slow", "fast", "normal" or milliseconds

"easing" is the string which specify the function for the transition.

"callback" is the function which we want to run once the animation effect is complete.

For example:

<div id="clickToAnimate">

Click Me

</div>

<div id="mydiv" style="width:200px; height:300px; position: relative; right: 20px;">

</div>

Following is the jQuery to animate opacity, left offset, and height of the mydiv element

$('# clickToAnimate').click(function() {

$('#book').animate({

opacity: 0.30,

left: '+=20',

height: 'toggle'

}, 3000, function() {

// run after the animation complete.

});

});

 210 views

80⟩ Define .siblings() method in jQuery?

When we want to fetch siblings of every elements in the set of matched elements then we can use siblings() method.

We filter the elements fetched by an optional selector.

Syntax : .siblings( [selector])

"selector" is the selector expression which specify the matched elements.

For example:

<ul>

<li> item 1 </li>

<li id="second_item"> item 2 </li>

<li class="myitem"> item 3 </li>

<li class="myitem"> item 4 </li>

</ul>

Now we want to find the siblings of the element of id "second_item" and change the text color to Blue :

$('li.second_item').siblings().css('color','blue');

If we want specific sibling elements for example the elements having class "myitem" then we can pass a optional selector:

$('li.second_item').siblings('.myitem').css('color','blue');

 205 views