527). Which of the following is not the feature of jQuery?
[A]Efficient query method for finding the set of document elements
[B]Expressive syntax for referring to elements in the document
[C] Useful set of methods for manipulating selected elements
[D]Powerful functional programming techniques is not used for operating on sets of elements as a group
Show Answer
Correct Answer: Powerful functional programming techniques is not used for operating on sets of elements as a group
Notes:
Answer: d
Explanation: These features are at the heart of jQuery’s power and utility:
An expressive syntax (CSS selectors) for referring to elements in the document
An efficient query method for finding the set of document elements that match a CSS selector
A useful set of methods for manipulating selected elements
Powerful functional programming techniques for operating on sets of elements as a group, rather than one at a time
A succinct idiom (method chaining) for expressing sequences of operations.
528). Which of the following is a single global function defined in the jQuery library?
[A] jQuery()
[B]$()
[C] Queryanalysis()
[D]global()
Show Answer
Correct Answer: jQuery()
Notes:
Answer: a
Explanation: 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. The $ sign it’s just an alias to jQuery(), then an alias to a function which is used as a selector element.
529). Which of the following is a factory function?
[A]$()
[B] jQuery()
[C]Queryanalysis()
[D]onclick()
Show Answer
Correct Answer: jQuery()
Notes:
Answer: b
Explanation: 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.
530). Which is the JavaScript code that asks for the set of all div elements in a document?
[A] var divs = $(div);
[B] var divs = jQuery("div");
[C] var divs = $("div");
[D]var divs = #("div");
Show Answer
Correct Answer: var divs = $("div");
Notes:
Answer: c
Explanation: :$ sign is used as an selector element and the argument passed to $ function is selected. The code to ask for the set of all div elements in a document is
531). Which is the method that operates on the return value of $()?
[A] show()
[B]css()
[C]click()
[D]done()
Show Answer
Correct Answer: css()
Notes:
Answer: b
Explanation: The css() method sets or returns one or more style properties for the selected elements. 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.”
532). What does the min mean in the following JavaScript code?
[A] Minimised version
[B]Miniature
[C]Minimised parameters
[D]Minimum value
Show Answer
Correct Answer: Minimised version
Notes:
Answer: a
Explanation: The min means the minimised version of the library, with unnecessary comments and whitespace removed, and internal identifiers replaced with shorter ones. The file size of minfile is smaller than the original file hence it makes it easier to load.
533). Which of the following is a heavily overloaded function?
[A]jQuery()
[B] $()
[C] script()
[D]Both jQuery() and $()
Show Answer
Correct Answer: Both jQuery() and $()
Notes:
Answer: d
Explanation: $() is just an alias function of jquery(). 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.
534). Which of the following is an equivalent replacement of $(document).ready(f)?
[A]jQuery(f)
[B]$(f)
[C]#(f)
[D]read(f)
Show Answer
Correct Answer: $(f)
Notes:
Answer: b
Explanation: The equivalent replacement of $(document).ready(f) is $(f). Writing $(document) performs the function of selecting the whole document which is the same as writing $() only.
535). Which of the following is a utility function in jQuery?
[A]jQuery.each()
[B]jQuery.parseJSON()
[C]jQuery.noConflict()
[D]jQuery.conflict()
Show Answer
Correct Answer: jQuery.noConflict()
Notes:
Answer: c
Explanation: jQuery.noConflict() is the utility function in jQuery. The noConflict() method releases the hold on the $ shortcut identifier, so that other scripts can use it.
536). Which of the following is used for parsing JSON text?
[A] jQuery.each()
[B]jQuery.parseJSON()
[C]jQuery.noConflict()
[D]jQuery.conflict()
Show Answer
Correct Answer: jQuery.parseJSON()
Notes:
Answer: b
Explanation: jQuery.parseJSON() is used for parsing JSON text. The function converts json to javascript object.
537). What will be the output of the following JavaScript code?
[A]Tables
[B]tables
[C]Undefined
[D]Error
Show Answer
Correct Answer: Tables
Notes:
Asnwer: a
Explanation: The i modifier is used to perform case-insensitive matching. It is found in the regex library of Javascript.
538). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 17
Notes:
Answer: b
Explanation: The lastIndex property specifies the index at which to start the next match. This property only works if the “g” modifier is set.
539). What will be the output of the following JavaScript code?
[A]IS
[B]is
[C]Error
[D]Undefined
Show Answer
Correct Answer: is
Notes:
Answer: b
Explanation: The m modifier is used to perform a multiline match. The m modifier treat beginning (^) and end ($) characters to match the beginning or end of each line of a string (delimited by \n or \r), rather than just the beginning or end of the string.
540). What will be the output of the following JavaScript code?
Show Answer
Correct Answer: 4
Notes:
Answer: a
Explanation: The o+ quantifier matches any string that contains at least one o. It concatenates the total number of o in a string.
541). What will be the output of the following JavaScript code?
[A]true
[B]false
[C]error
[D]undefined
Show Answer
Correct Answer: true
Notes:
Answer: a
Explanation: The n$ quantifier matches any string with n at the end of it. The above string has words ending with is therefore the output will be true.