Are you preparing a Jquery interview ? want some interview cracking Q&A's, then here your search end. You can get frequently asked JQuery Interview Questions and their answers, i am sure it will help you to break the interview
Let's start with it, Best Luck
1. What is JQuery?
2. What is $ in JQuery?
- Simple it is a function selector or a JQuery object, some says $ is a shortcut to the jQuery function
4. How to use JQuery?
- JQuery can be easily called with the help of its referenced libraries, first we need to give JQuery library reference to page and then call it using '$' sign
see below snippet, we can write JQuery in HEAD section
//here is JQuery reference
alert("Message on on page load")
above snippet shows, we can write JQuery in HEAD section and above code will call on Page load
5. What are the features of JQuery?
- JQuery is highly intractable, it has following features
6. What is JQuery UI?
it contains interactions, widgets and effects, we can build UI rich and highly interactive applications using it.
7. Which are the performance responsive selector?
- The elements which are selected using ID are the performance responsive selector as the ID is unique throughout the rendered page
9. What is has() in JQuery?
- has() is selection filter, it checks Check if an Element 'Has Something', means if i want to traverse my HTML file and check if DIV has list tag (OL) then we can check with has()
above code will select all element with 'ol'
10. Can JQuery parse XML?
- No, currently JQuery supports only HTML DOM parser
11. Can JQuery Run on MAC or Linux instead of Windows?
- JQuery support cross browser and cross platform compatibility hence it fluidly runs on Windows/MAC/Linux with all major browser compatibility (IE/Chrome/FF/NN/Safari)
12. When to use JQuery?
13. Which effects has inbuilt supported by JQuery?
- Hide, Show, Toggle, SlideDown, SlideToggle, SlideUp, FadeIn, FadeOut, Animate, FadeTo, FadeToggle, has inbuilt support by JQuery
14. Can we replace any character or variable instead of $ in JQuery?
- Yes, we can replace $ by using no Conflict () method, see below snippet to replace $
var szDoll = $.noConflict()
15. Tell me something about JQuery debugging?
JQuery can be debugged easily using following ways
16. What is Method chaining in JQuery?
- As name suggest it is the chain of methods executed in sequence, it is executed in single statement, see following snippet
//instead we can write
17. How to redirect a page using JQuery?
window.location.href = "http://test/default.aspx";
18. How to refresh a page using JQuery?
- you can use location.reload() method, to refresh page, see below snippet
19. How to check if element is hidden or visible using JQuery?
- You can use 'is()' method for 'display' or 'hidden' property, it returns boolean variable, see below snippet
20. What is difference in return false and preventDefault in JQuery?
- when we call return false, it first call e.preventDefault and then call e.stopPropagation which stop execution, where as e.preventDefault will prevent event to be bubbling up.
21. What is difference between "#" and "." selector in JQuery?
- Basically JQuery uses following notation as selector
22. Which are the most common JQuery evens?
Rome was not built in a day, still more to come, i will cover some more complex Q&A in Next version of this article, till then you can enjoy this most commonly asked question
Suggestion and queries are most welcome