Have you completed your jQuery course from and institute or by self-study and planning for an interview to start your career in a good UI development or website development company? If yes then all the following given questions will help you in cracking out the jQuery interview phase easily.
Q4. Is jQuery a replacement of Java Script?
Q5. Is jQuery for client scripting or server scripting?
Strictly jQuery is a client side scripting. It is very cool to create animations for web pages in maintainable manner.
Q6. Is jQuery a W3C standard? If no then why and if yes then what are the issues preventing jQuery in becoming a W3C standard?
Q8. Which is the starting point of code execution in jQuery?
$(document).ready() function takes this initiative and it fires functions inside it when DOM is ready.
Q9. What does dollar sign ($) means in jQuery?
$ is a function that called jQuery and it helps in managing all the functionality in the jQuery library.
$('div#id') === jQuery('div#id');
Q10. Should we have multiple document.ready() function on the same page?
Technically not !! It’s better to create an organized code structure by using one document.ready() and either put all the functions in it or call them as per the requirements.
Q11. Can we use our own specific character in the place of $?
Yes you can use surely. Please see the below given code.
var j = jQuery.noConflict();
Now j can be used in place of $ sign in all over the code.
Q12. Is it possible to use other client side libraries like MooTools, Prototype along with jQuery?
Q13. What is jQuery.noConflict?
Read question number 11 and 12 please.
Yes, onload or load event fires once all the contents are loaded of the page including images, scripts, media elements etc and in contrast jQuery.ready() or $.ready() event fires asap browser ensures for web page’s DOM is ready meaning $.ready() gets fires before the window.onload or $.load. You can use onload event when you are creating preloader but $.ready() can’t be used there and $.ready() is useful for interactive animations in the page.
Q15. What is the difference between .js and .min.js?
Q16. Why there are two different versions of jQuery library 1.x and 2.x?
jQuery 1.x is good when you want to create applications for IE 6, 7, and 8 and obviously jQuery 2.x is good for IE 8+.
Q17. What is a CDN?
CDN or Content Delivery Network is a network that helps in improving website’s performance at the production. Because there is a limit to resolve HTTP Requests on servers coming from websites so CDN is a great way to improve it by sharing content used in a website.
Q18. Which are the popular jQuery CDN and how to load from them?
Followings are the few popular jQuery CDN:
Q19. How to load jQuery locally when CDN fails?
As CDN is the best way to link a library but there might be a chance when due to heavy load a CDN server become unresponsive. So go with the following procedure always.
Q 20) What do you understand by the term Method chaining in jquery?
When we want various methods to be executed in a sequence in a single code statement, then this is called method chaining.
For instance :
Code without chaining :
$( "button#play-video" ).on( "click", playVideo ); $( "button#play-video " ).css( "background-color", "red" ); $( "button#play-video " ).show();
Code with chaining :
$( "button#play-video" ).on( "click", playVideo ) .css( "background-color", "red" ) .show();
Q 21) Explain the difference between jquery.ajax() and jquery.get()?
Jquery.get() – To build an ajax request for retrieval of information we use jquery.ajax. It also provides other requests such as jquery.post(), jquery.getJSON() etc. In this jquery.ajax is use under the hood.
Jquery.ajax() – It makes the use of different ajax request methods easy. We can easily customize the requests, we can customize how long do we want the user to wait for the response, failure handling, blocking or non-blocking of a request.
Q 22) What do you understand by .detach() as well as .remove()?
Ans) It’s very simple!!! Both are the same except a slight difference. .detach has all the values that are there even after removal. Whereas, this X-factor is not there in .remove(). That is why .detach is used when we want to retain the values that we deleted.
Q 23) Explain the following :
$(“div#name, div.name, ol#items > [firstname$=’name’]”)
Here some <div> element is used along with id i.e. name, along with all the div elements that have a class named as name and all elements that are children of the <ol id=”items> element where the attribute first name ends with the string “name”.
Q 24) Explain the difference between the two :
JQuery.attr() and JQuery.pop()
Jquery.attr() is generally used to get the value attribute for any first element that there is the set of elements that are matched.
Jquery .pop() is the one that is used to get the value of a property for the first element that is there in the set of matched elements.
Q 25) Name the different methods that you can use in jquery to provide the effects?
Here are the methods that are provided by jquery that are useful for providing effects on the webpage.
Following are the methods :
Want to know the answers to these questions in detail then I would recommend you visit our institute or call for course inquiry at 9811-8181-22. Our experts will help you surely.