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