Hello guys, welcome to our series jQuery.
Along with the previous segments, the practical portion, theory portion of our jQuery means whatever our to be learned content will end.
And today we will see interview questions of jQuery.
Whenever you appear for any web development or web developer for the interview or maybe appear for a website making any time means whatever is related to web, there when you go then the probability, situations of getting questions from jQuery are more than ninety percent.
So there are very many chances, there are a lot of chances that you will be asked about jQuery also in that.
So we will move forward in today’s segment.
Today i will tell you when you appear for the jQuery interview then what all questions will be there, not saying that the questions in this will only be asked in the interview but the questions taken for today’s segment are those questions which will be asked the most.
Either tricky or simple, the probability of getting both will be high.
So in today’s segment, we will focus on those types of questions that are very important from the perspective of the jQuery interview.
We will start our today’s segment.
The first interview question is what is jQuery?
If you are applying at the fresher level then you will be asked ‘what is jQuery?’at maximum chances.
If you are applying at the experience level it is not necessary that this question comes or not because this is not a low level but moderate level question that you will be asked what is jQuery.?
If you are asked, what is jQuery? Then what should its answer be?
And manipulation, browser event handling, we have seen through our course how do we do event handling in the browser with jQuery, how we manipulate DOM, how we add animations in DOM.
We have also learned AJAX through jQuery.
All this will be provided to us through jQuery.
So here, whatever is written in this answer plus whatever I have explained to you, that you can tell in the answer of what is jquery.
We will move forward with the second question.
Our question is what are jquery selectors?
Meaning what are all the selectors of jQuery?
We have covered this also in our segment.
You can give the answer to this in a way something like this, “jQuery selectors are used to select the HTML elements and allows you to manipulate the HTML elements” to say in a simple way all those things, all those elements, let them be elements, ID, see it is written here classes, ID, type, attribute, the value of attribute means anything.
If element then input, any p tag then you can say p, any h tag then you can say h one then it's additional.
Such input whose type is password like input in bracket type equal to password.
So we can take element in this way, we can add ID with the hashtag, we can add a class with dot, if we want to take only element then we can take h one means after dollar sign in the bracket, selector name means we can do this work by giving the name of that particular selector.
So, in jQuery, what are the jQuery selectors?
Then whatever names you took here, you can say all of those.
That whatever we pass inside the dollar parentheses , all those are our selectors.
We will move forward to the next question.
Our next question is : what are the methods used to provide effects?
Means what are all the methods used to provide effect?
For effects, in the jQuery effects module whatever we learned, you can say all these here.
Like, display effect in which we have learned three effects: hide, show and toggle.
Fading effect in which we have learned four things: fadein, fadeout, fadetoggle and fadeto.
In sliding effect in which we have learned slidedown, slideup, slidetoggle.
Then another effect, means there were other effects too like “animate and delay.
So whatever effects are given here, you can give all the names of them and if you give their heading like display, fading, sliding, and others.
Then this gives more impact on your interview that whoever person came to give the interview, he not only knows the names but also knows clubbing them to the family where they belong.
So if you remember both things then it is really well and good that what are all the methods, what effects do they provide and to which “effect family do they belong.
We can count this question as moderate level.
We will move forward with the difference between empty, remove and detach in jquery.
We have already seen the empty and remove, we will see detach here only.
What is the difference between these three?
So first of all comes the empty method.
So an empty method in jQuery is used to remove all child nodes and its content for the selected elements.
Meaning, on the selectors on which you have applied the empty method, with the help of empty method, on that selector, child, the very first thing, child element will be removed and second thing its content will also be removed.
That all will be removed from the DOM.
The second thing, remove.
What will happen with the “remove'' method?
It is used to remove all the selected elements including all text. This method also removes data and all the events of the selected elements.
So one more thing is added here, empty has not removed the specific element on which empty was applied, it has removed its child and removed the content of the child.
What has the remove method done?
Removed element, removed child, removed its data also and to which, means with our element whatever bind events are there click, mouse, mouse, enter, whatever, has removed them too along with it.
Now comes the detach method.
What is the work of detach?
“The detach method in jQuery is used to remove the selected elements from the DOM including all text and child nodes but it keeps the data and the events.”
Means, if event, if empty and remove methods remove but the events will be removed only by the remove method. The empty method will not remove the events.
Then what does detach do?
It does some work for both.
Means it does some work of empty, some work of remove.
So what will detach basically do?
It will remove selected elements plus including, means what else will it remove?
It will remove text, it will remove child nodes but it will let data and events stay.
Means, that by taking some work from both for whatever is given to detach, the detach method will do it.
“DOM is a World Wide Web Consortium Standard. This defines for accessing elements in the DOM tree.”
Means even after removing, with the help of the DOM tree, means when we keep on inspecting if you want to utilize after inspect then we can do it with the help of detach.
Because all things will exist inside the DOM.
We can utilize it from there.
So this is our example of empty, removed, and detached.
This question is at the advanced level.
The chances are less on freshers but not like they will not ask.
They can ask.
But the probability of this coming in experience level is more.
Our next question is to “mention the compatible operating systems with jQuery.”
Very simple question.
Very easy question.
Name such an operating system which is compatible with jQuery then all the currently available operating systems are all compatible with jQuery like our normal take mac, windows,linux.
All the operating systems are compatible with jQuery.
This will come to freshers only, the chances are very less for experience level, this will be only asked for freshers.
Further question is how to include jQuery library in the ASP dot net project?
Whatever we have learned throughout the segment, in our complete jQuery web designer, in that we have learned how to add jQuery libraries.
Then we usually added our URL, URL of the library inside the script tag.
But if I want to add inside the project then can I do it?
Now we are taking ASP dot net but it's not mandatory.
How can you add it to an angular project?
How to react?
Then the steps are almost the same.
What are steps for ASP?
Download the jQuery library from jQuery dot com first.
Include that reference in the ASP dot net page.
Meaning, like, our page here, I will open it, this is our website.
Here if we go to downloads then from the downloads you can download whatever the compatible version, whatever you need from here and we can add its reference in our project.
Next, other options than ASP dot net, that if you use visual studios then you can add in this way too like NPM install jQuery or yarn add jQuery.
And here is bower install jQuery to download.
Mostly used, our option is NPM install jQuery.
Using this command you can install jQuery in the visual studio.
So one of the other ways is downloading jQuery from the site, this is also an option and give its reference in your page then here there is an option to add in every page of ASP dot net.
We are seeing other than ASP dot net, specifically visual studio because maximum web development or website development then we either use our sublime text for static sites plus we also use visual studio for dynamic projects.
In this way we can install it is also fine or you can give your reference in every page.
This is our question.
This is the question of similar probability for both fresher level and experience level.
We will move forward with the question.
Difference between find and children methods.
We have already learned this when we covered the jQuery traversing module.
Today we will see the difference between find and children.
When we were learning even then I have the answer to this, now I will repeat it again. What is the actual need to find?
“The find method is used to find all the descendant elements of the selected element.”
Meaning, all the descendants, “child will be available, it will give all the finds to us.
But what do children do?
“Is used to find all the children elements related to the selected element.”
Means there will be levels.
So what does find do?
If we have selected one element then it is not like it will go exactly to its next level, it can go to multi level meaning children, grandchildren also it will find and give.
But what will children do?
It will only go to a single level before a specific element.
It will not go below that.
So all the children till single level will only be returned to you.
Grand children and their great grandchildren will not be returned to you.
Only children will be returned.
So the difference is, you can also answer in this way, so if you want to find child elements in the single level then use children but if you want to go multi level then use find.
Further there is the eighth question.
In what scenarios jQuery can be used?
This question can definitely come at fresher level because when you appear at the interview then just by asking basic questions no one will hire.
How logical you give your answer is also a very important part.
So what are all the scenarios in which jQuery can be used? Is our question.
So, mainly for animation effects.
Means we can give animations in easy ways using jQuery.
That is the reason jQuery is used to give the animation effect.
Second, manipulation purpose.
Means when our DOM document object model, we need to add something dynamically in DOM, dynamically delete something then for that manipulation we use jQuery.
Calling functions on events.
Means by clicking on any function on the event, by double clicking, by hovering mouse, by removing mouse, on pressing/deleting keyboard etc etc., if we want to function call on every event then we can use jQuery.
And last, apply CSS static or dynamically.
Means, let's say I have not applied CSS from the beginning, I will click on the button and CSS will come, I will hire any event and CSS will come.
So for these kinds of dynamic tasks, if I want to do something then I will use jQuery.
This question might also be a question like if I don’t want to apply CSS through style tag then what other approach can I use?
Then you can give the answer as “I can give the dynamic or static CSS through jQuery because jQuery provides a dot CSS method”.
So all these four points written here, you can all four answer for what scenarios jQuery can be used for.
We will move forward. The ninth question is what is a dollar in the jQuery library?
We learned this module, very first, the production part, in that we have learned that we call dollars as factory function also.
What is in the jQuery library?
Then the answer for it is “dollar function is an alias of jQuery function”.
Means wherever you want to use jQuery you can use the dollar function exactly there.
Means ideally this dollar and this parent.
This dollar function indicates that the part written now in our program, in the webpage that is the indication of our jQuery.
Means this so and so part that is written with “dollar, its execution will be handled through jQuery library.
If you write something related to style like dot, class and then curly basis, open and close, then that will be our CSS, if you write something with dollar then that will be our jQuery.
We will move forward.
“It is used to wrap any object into a jQuery object which later facilitates you to call the various methods defined in the jQuery object.”
Means you have to handle jQuery objects then in which you need to write it in this dollar parentheses.
You can pass a selector string to this factory function and it returns a jQuery object which contains an array of all matched DOM elements.
Means, this is the internal thing, this is not to be seen outside, this will not be seen in the output.
Internally what will this factory function do?
Whatever we passed in the dollar parentheses, it will consider that element as an object and whatever array generated related to that object like child, parent, along with that applied CSS, situation in DOM, all the details related to that element this factory function will return from the DOM element.
This one is a very tricky and logical question.
This doesn’t come in simple questions.
There are chances for freshers plus there are also chances for experience level that what does dollar factory function actually do.
Experienced people especially remember the uses of factory functions.
Last statement which I said “it returns a jQuery object” is important.
We will move forward toward our last question.
Our last question is, is it possible for jQuery HTML work for both HTML and XML documents?
For this you need to have an idea about what is HTML, whatever HTML course we did, whatever programs we made through jQuery, all those are simple HTML programs.
I have given you a rough idea about XML and what is XML.
It is like HTML but it is not HTML.
In XML we write tags according to us, there are some criteria for it like if it has a starting tag then its ending tag is a must.
There is a format to write.
We use namespace etc etc.
So HTML and XML are two different scripting languages but there is some difference in both of them.
We don’t usually use HTML in request response but the response we get from the server will be in the XML format.
So the answer for our question whether our jQuery will work for both HTML and XML then the answer for it is no.
jQuery will only work for HTML documents, it will not work for XML documents.
So if you are using HTML and jQuery then jQuery will work with HTML DOM that is created, the same functions will be applied on HTML.
But if you are going to do the same thing with XML then it is not possible.
So make sure you will remember this thing for the interview.
jQuery is only compatible for HTML, it will not work for XML.
I have taken selected questions, here our jQuery web designing interview questions will end.
If in today’s questions whatever I have explained if you have any doubt related to its a answers or you have not understood something or even if you want to ask other than this or even if there is a question out of this which you have not understood then you can show them to us on forums.learnvern.com.
We will, to this question doubts plus your questions, we will resolve and revert to all the doubts in this forums.learnvern.com. Discussion to be added.
So guys, these are our jquery interview questions.
I hope this will be very useful to you.
Thank you so much and all the best.
Share a personalized message with your friends.