November 5, 2016 0 Welcome to your jQuery Test Name What is the difference between Hover and Mouseover Hover allows you to specify an optional function to use for the mouseout event Mouseover allows you to specify an optional function to use for the mouseout event No Difference; Mouseover and Hover are Which jQuery method is used to hide selected elements? display(none) hide() visibility(false) hidden() What is the correct jQuery code to set the background color of all p elements to red? $("p").style("background-color","red"); $("p").manipulate("background-color","red"); $("p").css("background-color","red"); $("p").layout("background-color","red"); jQuery is Interpreter compiled Runs in js shell parallelly processed Light weight Which is true while traversing sideways in the DOM tree? I. The next() method returns the next sibling element of the selected element II. The next() method returns all next subsibling elements of the selected element III. The nextUntil() method returns all next sibling elements between two given arguments IV. The nextUntil() method returns all next subsibling elements between two given arguments. I and II only I, II, III II,IV I and III only jQuery is a JavaScript Language JavaScript Method JavaScript Library PHP Method .$(function(){}); What does this piece of jQuery do? This is to test if jQuery has completed execution This is to test if jQuery can be loaded again This is a shorter version for $(document).ready(function(){}); This is to create a method in jQuery Which is not used to display data into HTML ? innerHTML document.write() None of these console.log() Can we use selector into jquery ? YES NO Which function do you reference in HTML form data? value() None of the above val() formData() Multiple document.ready blocks can be placed in a page without detriments. This statement is.. True False Which jQuery method is used to perform an asynchronous HTTP request? jQuery.ajaxAsync() jQuery.ajaxSetup() jQuery.ajax() jQuery Stop() function is used to I. Stop execution of current fading effect II. Stop execution of current sliding effect III. Stop the execution of all DOM action events Both A and B Both B and C None of these Both A and C $('#masterList').find('li') .width(500).addClass('selected'); The phenomena occuring in the above code is called? Callback Event bubbling AJAX Chaining into jQuery, I. The load() method loads data from a server and puts the returned data into the selected element. II. The load() method loads data from a client machine and puts the data into the selected element. III. The load() method loads data from a server and clients and puts the returned data into the specified element. All I, II, III I and III I, and II I only Why do we usually add the stop() method before calling animate()? stop() halts the execution of the scripts on the page until the animation has finished. We tell jQuery that the animation has to be stopped at some point. stop() ends any currently running animations on the element, and prevents conflicts and pile-ups. What are the :odd and :even filters? Both A and B They allow you to determine if a number is odd or even They allow you to determine if a specific element is in an odd or even position. None of the above Which is not true for math function? I.ceil(x) returns the value of x roundedDown to its nearest integer II. floor(x) returns the value of x roundedUp to its nearest integer III. abs(x) returns the absolute (positive) value of x IV. exp(x) returns the value of Ex I , III and IV I and III I and II II and IV If you want to stop your jQuery for a few milliseconds, which function do you use? delay() stop() pause() slowdown() With the jQuery AJAX methods, you can request text, HTML, XML, or JSON from a remote server using both HTTP Get and HTTP Post - And you can load the external data directly into the selected HTML elements of your web page ? A. True False With jQuery, look at the following selector: $("div.intro"). What does it select? All div elements with id="intro" All div elements with class="intro" The first div element with id="intro" The first div element with class="intro" Which are valid general rules for constructing names for variables I. Names can contain letters, digits, underscores, and dollar signs. II. Names must begin with a letter III. Names can also begin with $ and _ (but we will not use it in this tutorial) IV. Names are case sensitive (y and Y are different variables)V.Reserved words (like JavaScript keywords) cannot be used as names V. Reserved words (like JavaScript keywords) cannot be used as names I,II, III I and IV I,IV, and V All of these var ps = $("p"); ps will be.. An array A jQuery object A linked list A hash or dictionary What scripting language is jQuery written in? JavaScript C++ C# VBScript What is the difference between .width() and .outerWidth()? No difference. width() is a shorthand alias for outerWidth() width() returns the computed width of the element, while outerWidth() returns the width plus all the margins and paddings The methods are basically the same. The only difference is that .width() returns a number, whereas outerWidth() a string. AJAX Stands for Asynchronous JavaScript and XML Advanced jQuery and XML Advanced JavaScript Extended Asynchronous jQuery Extended Which is not jQuery Slide method? slideToggle() slideDown(),slideUp() both A and B slideRight(), slideLeft() You can attach a handler to an event using which method? bind attach eventAttach eventBind What are the various speed options? None of the above Only the words "slow", "fast", and "medium" The words "slow" and "fast" as well as integers for the milliseconds All of the above The jQuery html() method works for both HTML and XML documents False True Which syntax is correct to hide DOM element using Callback function $(selector).hide(speed,callback) $(selector).hide(callback, speed) $(selector).hide(callback,next_event) $(selector).hide() What is not true about array methods? The shift() method removes the first array element and "shifts" all other elements to a lower index The unshift() method adds a new element to an array (at the beginning), and "unshifts" older elements The pop() method removes the last element from an array The push() method adds a new element to an array from the end Delete is also used to remove element from index and to free the index JavaScript statements are executed line by line. However, with effects, the next line of code can be run even though the effect is not finished. This can create errors. To prevent this, you can use Callback function Chaining function Counter function Stop function $(document).ready(function() { // Some code. }); The above code is used to.. Both A and B Make sure no code is executed till the entire page is fully loaded Make sure no code is executed till the DOM is fully loaded Neither A nor B How do you fetch the first span on the page, which has the class ‘green’? $('span.green:first') $('span, .green, :first') $('first .green span') When referencing an HTML element preceded by a # (pound or hash), what javascript function is this equivalent to? None of the above getElementByTagName getElementById getElementByClassName AJAX and jQuery jQuery provides a rich set of methods (functions) for AJAX web development A and B AJAX and jQuery are cross-platform (you can develop in Windows and serve on a Unix platform) With jQuery AJAX, you can request TXT, HTML, XML or JSON data from a remote server using both HTTP Get and HTTP Post The speed options can be applied to which jQuery functions? show and fadeIn css and ajax toggleCss All of the above $('p').click(function(){ // Code here }); Inside the commented section, the value of the variable this is a.. String Array Reference to the DOM node jQuery object $.foo() is equivalent to.. document.foo() jQuery.foo() None of the above javascript.foo() When referencing an HTML element preceded by a . (dot), what javascript function is this equivalent to? None of the above getElementByClassName getElementById getElementByTagName Which jQuery method is used to set one or more style properties for selected elements? html() css() style() Which jQuery function is used to prevent code from running, before the document is finished loading? $(body).onload() $(document).load() $(document).ready() Load remote data using HTTP GET $.getScript(url,callback) $.ajax(options) $.post(url,data,callback,type) $.get(url,data,callback,type) Which jQuery method is used to switch between adding/removing one or more classes (for CSS) from selected elements? switch() altClass() switchClass() toggleClass() jQuery's main focus is.. AJAX Animations DOM Manipulation All of the above Look at the following jQuery selector: $("div #intro .head"). What does it select? All div elements with id="intro" or class="head" All elements with class="head" inside the first div element with id="intro" The first element with id="head" inside any div element with class="intro" When do you use the $(this) code? When an HTML element will reference the entire document None of the above When an HTML element will reference its parent element's action When an HTML element will reference its own action With jQuery, look at the following selector: $("div"). What does it select? The first div element All div elements Time's up