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