ExamVeda
Login
Home
51
Which of the following are the features of jQuery?
Discuss
Answer & Solution
Answer: Option D
Solution:
These features are at the heart of jQuery’s power and utility:
1. An expressive syntax (CSS selectors) for referring to elements in the document
2. An efficient query method for finding the set of document elements that match a CSS selector
3. A useful set of methods for manipulating selected elements
4. Powerful functional programming techniques for operating on sets of elements as a group, rather than one at a time
5. A succinct idiom (method chaining) for expressing sequences of operations.
52
Which of the following is a single global function defined in the jQuery library?
Discuss
Answer & Solution
Answer: Option A
Solution:
The jQuery library defines a single global function named jQuery(). This function is so frequently used that the library also defines the global symbol $ as a shortcut for it.
53
Which of the following is a factory function?
Discuss
Answer & Solution
Answer: Option B
Solution:
jQuery() is a factory function rather than a constructor: it returns a newly created object but is not used with the new keyword) jQuery objects define many methods for operating on the sets of elements they represent, and most of this chapter is devoted to explaining those methods.
54
Which is the code that asks for the set of all div elements in a document?
Discuss
Answer & Solution
Answer: Option C
Solution:
The code to ask for the set of all div elements in a document is
var divs = $("div");
55
Which is the method that operates on the return value of $()?
Discuss
Answer & Solution
Answer: Option B
Solution:
The css() method operates on the jQuery object returned by $(), and returns that same object, so that the show() method can be invoked next in a compact “method chain.”
56
Consider the following code snippet
script src="jquery-1.4.2.min.js"></script>
What does the min mean?
Discuss
Answer & Solution
Answer: Option A
Solution:
The min means the minimised version of the library, with unnecessary comments and whitespace removed, and internal identifiers replaced with shorter ones.
57
Which of the following is a heavily overloaded function?
Discuss
Answer & Solution
Answer: Option D
Solution:
The jQuery() function (a.k.a) $()) is the most important one in the jQuery library. It is heavily overloaded, however, and there are four different ways you can invoke it.
58
Which of the following is an equivalent replacement of $(document).ready(f)?
Discuss
Answer & Solution
Answer: Option B
Solution:
The equivalent replacement of $(document).ready(f) is $(f).
59
Which of the following is a utility function in jQuery?
Discuss
Answer & Solution
Answer: Option C
Solution:
jQuery.noConflict() is the utility function in jQuery.
60
Which of the following is used for parsing JSON text?
Discuss
Answer & Solution
Answer: Option B
Solution:
jQuery.parseJSON() is used for parsing JSON text.