November 5, 2016 0 Welcome to your jQuery Test Name 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, II, III I and II only II,IV I and III only What is the difference between Hover and Mouseover Hover allows you to specify an optional function to use for the mouseout event No Difference; Mouseover and Hover are Mouseover allows you to specify an optional function to use for the mouseout event Which jQuery method is used to perform an asynchronous HTTP request? jQuery.ajaxAsync() jQuery.ajaxSetup() jQuery.ajax() With jQuery, look at the following selector: $("div"). What does it select? All div elements The first div element jQuery's main focus is.. All of the above DOM Manipulation Animations AJAX Look at the following jQuery selector: $("div #intro .head"). What does it select? The first element with id="head" inside any div element with class="intro" All div elements with id="intro" or class="head" All elements with class="head" inside the first div element with id="intro" With jQuery, look at the following selector: $("div.intro"). What does it select? The first div element with class="intro" All div elements with id="intro" All div elements with class="intro" The first div element with id="intro" $.foo() is equivalent to.. None of the above document.foo() javascript.foo() jQuery.foo() $(document).ready(function() { // Some code. }); The above code is used to.. Neither A nor B Make sure no code is executed till the DOM is fully loaded Both A and B Make sure no code is executed till the entire page is fully loaded jQuery is a JavaScript Language JavaScript Library PHP Method JavaScript Method What scripting language is jQuery written in? C++ VBScript C# JavaScript AJAX and jQuery A and B AJAX and jQuery are cross-platform (you can develop in Windows and serve on a Unix platform) jQuery provides a rich set of methods (functions) for AJAX web development With jQuery AJAX, you can request TXT, HTML, XML or JSON data from a remote server using both HTTP Get and HTTP Post 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 B and C Both A and B Both A and C None of these When do you use the $(this) code? When an HTML element will reference its parent element's action None of the above When an HTML element will reference its own action When an HTML element will reference the entire document Multiple document.ready blocks can be placed in a page without detriments. This statement is.. False True AJAX Stands for Advanced JavaScript Extended Advanced jQuery and XML Asynchronous JavaScript and XML Asynchronous jQuery Extended Which jQuery method is used to set one or more style properties for selected elements? html() css() style() The speed options can be applied to which jQuery functions? All of the above toggleCss show and fadeIn css and ajax If you want to stop your jQuery for a few milliseconds, which function do you use? pause() stop() delay() slowdown() How do you fetch the first span on the page, which has the class ‘green’? $('first .green span') $('span, .green, :first') $('span.green:first') Why do we usually add the stop() method before calling animate()? 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. stop() halts the execution of the scripts on the page until the animation has finished. Load remote data using HTTP GET $.post(url,data,callback,type) $.ajax(options) $.getScript(url,callback) $.get(url,data,callback,type) .$(function(){}); What does this piece of jQuery do? This is to create a method in jQuery This is to test if jQuery can be loaded again This is a shorter version for $(document).ready(function(){}); This is to test if jQuery has completed execution Which is not used to display data into HTML ? None of these innerHTML console.log() document.write() 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 and II I and III II and IV I , III and IV 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 Which jQuery method is used to switch between adding/removing one or more classes (for CSS) from selected elements? toggleClass() switchClass() switch() altClass() var ps = $("p"); ps will be.. A hash or dictionary A jQuery object A linked list An array What is the difference between .width() and .outerWidth()? width() returns the computed width of the element, while outerWidth() returns the width plus all the margins and paddings No difference. width() is a shorthand alias for outerWidth() The methods are basically the same. The only difference is that .width() returns a number, whereas outerWidth() a string. jQuery is Interpreter compiled Light weight parallelly processed Runs in js shell 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. I, and II All I, II, III I and III I only Can we use selector into jquery ? NO YES What are the :odd and :even filters? Both A and B None of the above They allow you to determine if a specific element is in an odd or even position. They allow you to determine if a number is odd or even What is not true about array methods? The push() method adds a new element to an array from the end The pop() method removes the last element from an array 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 Delete is also used to remove element from index and to free the index You can attach a handler to an event using which method? eventBind attach bind eventAttach Which is not jQuery Slide method? slideDown(),slideUp() slideRight(), slideLeft() both A and B slideToggle() When referencing an HTML element preceded by a . (dot), what javascript function is this equivalent to? getElementByTagName getElementById None of the above getElementByClassName Which jQuery function is used to prevent code from running, before the document is finished loading? $(body).onload() $(document).load() $(document).ready() The jQuery html() method works for both HTML and XML documents True False $('#masterList').find('li') .width(500).addClass('selected'); The phenomena occuring in the above code is called? AJAX Callback Event bubbling Chaining 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 All of these I,IV, and V I,II, III I and IV Which function do you reference in HTML form data? val() None of the above value() formData() What are the various speed options? Only the words "slow", "fast", and "medium" All of the above The words "slow" and "fast" as well as integers for the milliseconds None of the above $('p').click(function(){ // Code here }); Inside the commented section, the value of the variable this is a.. String jQuery object Reference to the DOM node Array 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 Stop function Chaining function Counter function Callback function What is the correct jQuery code to set the background color of all p elements to red? $("p").css("background-color","red"); $("p").layout("background-color","red"); $("p").style("background-color","red"); $("p").manipulate("background-color","red"); When referencing an HTML element preceded by a # (pound or hash), what javascript function is this equivalent to? getElementByClassName getElementByTagName None of the above getElementById Which syntax is correct to hide DOM element using Callback function $(selector).hide(callback,next_event) $(selector).hide(callback, speed) $(selector).hide(speed,callback) $(selector).hide() Which jQuery method is used to hide selected elements? hide() display(none) hidden() visibility(false) Time's up