Join Regular Classroom : Visit ClassroomTech

jQuery – Interview Questions | Codewindow.in

1. What is jQuery?

jQuery is a feature-rich JavaScript library that makes HTML document traversal and manipulation, event handling, animation, and Ajax much simpler and faster. jQuery has an easy-to-use API that works across many browsers. UI related functions can be written with minimal lines of code using jQuery.

2. What are the core features of jQuery?

Following is the list of important core features supported by jQuery −

DOM manipulation − The jQuery made it easy to select DOM elements, traverse them and modifying their content by using cross-browser open source selector engine called Sizzle.

Event handling − The jQuery offers an elegant way to capture a wide variety of events, such as a user clicking on a link, without the need to clutter the HTML code itself with event handlers.

AJAX Support − The jQuery helps you a lot to develop a responsive and feature-rich site using AJAX technology.

Animations − The jQuery comes with plenty of built-in animation effects which you can use in your websites.

Lightweight − The jQuery is very lightweight library – about 19KB in size ( Minified and gzipped ).

Cross Browser Support − The jQuery has cross-browser support, and works well in IE 6.0+, FF 2.0+, Safari 3.0+, Chrome and Opera 9.0+.

Latest Technology − The jQuery supports CSS3 selectors and basic XPath syntax.

3. What is the difference between JavaScript and jQuery?

JavaScript is an interpreted programming language, whereas jQuery is a library with APIs built for JavaScript. jQuery simplifies the use of the JavaScript language.

4. What are the effects methods used in jQuery?

jQuery enables us to add effects on a web page. jQuery effects can be categorized into fading, sliding, hiding/showing, and animation effects. jQuery provides many methods for effects on a web page
These are the effects methods used in jQuery:
show() – It displays or shows the selected elements.
hide() – It hides the matched or selected elements.
toggle() – It shows or hides the matched elements. In other words, it toggles between the hide() and shows () methods.
fadeIn() – It shows the matched elements by fading it to opaque. In other words, it fades into the selected elements.
fadeOut() – It shows the matched elements by fading it to transparent. In other words, it fades out the selected elements.

5. What are the features of jQuery?

Some important features of jQuery are:

Easy DOM manipulation using the Sizzle engine.

Event handling & AJAX support.

Built-in effects and animations.

Lightweight library.

Cross-browser compatibility.

Supports CSS3, basic XPath, HTML5.

C QA

Mostly Asked

DS QA

Mostly Asked

DBMS QA

Mostly Asked

ML QA

Mostly Asked

6. How will you make sure that DOM is ready using jQuery?

Use $(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page contents are loaded.

7. Explain the Advantages of jQuery?

The advantages of jQuery are:

Simple and easy to use.

Has extensive documentation in the form of blogs, code snippets, tutorials, and other resources

Simple and clean syntax.

Open coding standards, intuitive.

Deals with cross-browser issues without the developer having to worry about them.

Lightweight with the core library being just 24kb.

Open-source library.

Exhaustive set of animations and effects.

Extensible and fast.

It can be optimized for search engines for better SEO.

8. What is jQuery Ajax?

AJAX is an acronym standing for Asynchronous JavaScript and XML, and this technology helps us load data and exchange data with the server without a browser page refresh. JQuery is a great tool that provides a rich set of AJAX methods to develop next-generation web applications.

9. What are the categories in jquery Events?

The common DOM events are as follows

Form

Keyboard

Mouse

Browser

Document Loading

10. What is the use of css() method in JQuery?

The jQuery CSS() method is used to get (return)or set style properties or values for selected elements. It facilitates you to get one or more style properties.

11. What are the selectors in jQuery, and what are the types of Selectors?

If you would like to work with an element on the web page, first you need to find or select it. Selectors find the HTML elements using jQuery.

There are many types of selectors in the jQuery library. Some basic selectors are:

Name: It is used to select all elements which match with the given element Name.

#ID: It is used to select a single element which matches with the given ID

.Class: It is used to select all elements which match with the given Class.

Universal (*): It is used to select all elements available in a DOM.

Multiple Elements E, F, G: It is used to select the combined results of all the specified selectors E, F, or G.

Attribute Selector: It is used to select elements based on its attribute value.

12. What is the difference between onload() and document.ready() methods?

Body.Onload() event will be called only after the DOM and associated resources like images get loaded, but jQuery’s document.the ready() event will be called once the DOM is loaded, and it does not wait for the resources such as images to be loaded.

13. What is jQuery connect?

A jQuery connect is a plug-in used to connect or bind a function with another function. Connect is used to execute a function whenever a function from another object or plug-in is executed.

14. What is the difference between jquery.min.js and jquery.js?

jquery.min.js is a compressed version of jquery.js(whitespaces and comments are removed, shorter variable names are used, and so on) to preserve bandwidth. In terms of functionality, they are absolutely the same. It is recommended to use this compressed version in the production environment. The efficiency of a web page increases when the minimized version of jQuery is used.

15. What is jQuery UI?

jQuery UI is a set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. jQuery UI works well for highly interactive web applications with many controls or for a simple page with a date picker control.

16. What is Qunit?

QUnit is a powerful, easy-to-use JavaScript unit testing framework. It’s used by the jQuery, jQuery UI, and jQuery Mobile projects and is capable of testing any generic JavaScript code.

17. Differentiate among .empty() vs .remove() vs .detach() in jQuery.

remove(): removes the element as well as its child elements. Data from DOM can be restored; however, event handlers can’t be restored.

empty(): does not remove the element; however, remove its content, and the associated child elements

detach(): removes the element and all the associated child elements, but retains the data and event handlers of the removed element to be reused later.

Example usage:

$(“#div-element”).remove();

$(“#div-element”).empty();

$(“#div-element”).detach();

18. What is jQuery.noConflict?

Usually, JS functions and variables use $ as a name. In jQuery, $ is just an alias for jQuery, so we don’t need to use $. If we have to use a JS library along with jQuery, the control of $ is given to the JS library. To give this control, we use jQuery.noConflict(). It is also used to assign a new name to a variable.

Categories
Pages
Recent Posts