1⟩ Why jQuery is better than JavaScript?
jQuery is a library used for developing Ajax application and it helps to write the code clean and concise. It also handles events, animation and Ajax support applications.
“JQuery Programmer Frequently Asked Questions in various JQuery Developer job Interviews by interviewer. The set of questions here ensures that you offer a perfect answer posed to you. So get preparation for your new job hunting”
jQuery is a library used for developing Ajax application and it helps to write the code clean and concise. It also handles events, animation and Ajax support applications.
jQuery is needed for the following list:
► Used to develop browser compatible web applications
► Improve the performance of an application
► Very fast and extensible
► UI related functions are written in minimal lines of codes
The four parameters are
► URL - Need to specify the URL to send the request
► type - Specifies type of request(Get or Post)
► data - Specifies data to be sent to server
► Cache - Whether the browser should cache the requested page
jQuery file should be added to the Master page and can use access from the content page directly without having any reference to it.
Browser compatibility of jQuery plugin is an issue and needs lot of time to fix it.
Chaining is used to connect multiple events and functions in a selector.
jQuery is a client scripting.
$.ajax can be called and by declaring WebMethod inside code behind using jQuery.
There are 3 popular jQuery CDNs.
1. Google.
2. Microsoft
3. jQuery.
Advantage of using CDN.
► It reduces the load from your server.
► It saves bandwidth. jQuery framework will load faster from these CDN.
► 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
There are two ways to debug jQuery:
Debugger keyword
► 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.
► Insert a break point after attaching the process
jQuery load method is a powerful AJAX method which is used to load the data from a server and assign the data into the element without loading the page.
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.
A '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.
jQuery can be used in following scenarios:
☛ Apply CSS static or dynamic
☛ Calling functions on events
☛ Manipulation purpose
☛ Mainly for Animation effects
QUnit is used to test jQuery and it is very easy and efficient.
Yes. It is possible using jQuery.noConflict().
jQuery data method is used to associate data with DOM nodes and JavaScript objects. This method will make a code very concise and neat.
The .animate() method allows us to create animation effects on any numeric CSS property. This method changes an element from one state to another with CSS styles. The CSS property value is changed gradually, to create an animated effect.
Syntax is:
(selector).animate({styles},speed,easing,callback)
styles: Specifies one or more CSS properties/values to animate.
duration: Optional. Specifies the speed of the animation.
easing: Optional. Specifies the speed of the element in different points of the animation. Default value is "swing".
callback: Optional. A function to be executed after the animation completes.
Simple use of animate function is,
$("btnClick").click(function(){
$("#dvBox").animate({height:"100px"});
});
jQuery is a fast and concise JavaScript Library created by John Resig in 2006 with a nice motto - Write less, do more. jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is a JavaScript toolkit designed to simplify various tasks by writing less code.
jQuery is not a programming language but a well written JavaScript code. It is a JavaScript code, which do document traversing, event handling, Ajax interactions and Animations.
► .empty() method is used to remove all the child elements from matched elements.
► .remove() method is used to remove all the matched element. This method will remove all the jQuery data associated with the matched element.
► .detach() method is same as .remove() method except that the .detach() method doesn't remove jQuery data associated with the matched elements.
► .remove() is faster than .empty() or .detach() method.
Syntax:
$(selector).empty();
$(selector).remove();
$(selector).detach();