Home Interview Questions and Answers Jquery Interview questions and Answers For Developers Part-8

jquery71. How to use migrate jQuery plugin?
with release of 1.9 version of jQuery, many deprecated methods were discarded and they are no longer available. But there are many sites in production which are still using these deprecated features and it’s not possible to replace them overnight.

72. Is it possible to get value of multiple CSS properties in single statement?
Well, before jQuery 1.9 release it was not possible but one of the new feature of jQuery 1.9 was .css() multi-property getter.
var propCollection = $(“#dvBox”).css([ “width”, “height”, “backgroundColor” ]);

In this case, the propCollection will be an array and it will look something like this.
Hide   Copy Code

width: “100px”,
height: “200px”,
backgroundColor: “#FF00FF”

73. How do you stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements?
It can be done via calling .stop([clearQueue ] [, jumpToEnd ]) method and by passing both the parameters as true.

74. What is finish method in jQuery?
The .finish() method stops all queued animations and places the element(s) in their final state. This method was introduced in jQuery 1.9.

75. What is the difference between calling stop(true,true) and finish method?
The .finish() method is similar to .stop(true, true) in that it clears the queue and the current animation jumps to its end value. It differs, however, in that .finish() also causes the CSS property of all queued animations to jump to their end values, as well.

76. Consider a scenario where things can be done easily with javascript, would you still prefer jQuery?
No. If things can be done easily via CSS or JavaScript then You should not think about jQuery. Remember, jQuery library always comes with xx kilobyte size and there is no point of wasting bandwidth.

77. Can we use protocol less URL while referencing jQuery from CDNs?
Yes. Below code is completely valid.
Hide   Copy Code

<script type=”text/javascript” src=”//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js”></script>

78. What is the advantage of using protocol less URL while referencing jQuery from CDNs?
It is quite useful when you are moving from HTTP to HTTPS url. You need to make sure that correct protocol is used for referencing jQuery library as pages served via SSL should contain no references to content served through unencrypted connections.

“protocol-less” URL is the best way to reference third party content that’s available via both HTTP and HTTPS. When a URL’s protocol is omitted, the browser uses the underlying document’s protocol instead. Find out more here.

79. What is jQuery plugin and what is the advantage of using plugin?
A plug-in is piece of code written in a standard JavaScript file. These files provide useful jQuery methods which can be used along with jQuery library methods. jQuery plugins are quite useful as its piece of code which is already written by someone and re-usable, which saves your development time.

80. What is jQuery UI?
jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library that can be used to build interactive web applications.

You may also like

Leave a Comment