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