lis2360 Exam 2
What is the correct jQuery code for making all div elements 300 pixels high? A) $("div").yPos(300) B) $("div").height(300) C) $("div").pixel(300) D) $("div").height = 300
A) $("div").height(300)
Which jQuery function is used to prevent code from running, before the document is finished loading? A) $(document).ready() B) $(document).onload() C) $(document).load() D) $(document).onready()
A) $(document).ready()
With jQuery, look at the following selector: $("div.intro"). What does it select? A) All div elements with class = "intro" b) The first div element with id = "intro" C) The first div element with class = "intro" D) All div elements with id = "intro"
A) All div elements with class = "intro"
Through the ____ object you can access other objects that represent elements on a Web page A)Document B)Image C)Input D)Element
A) DOCUMENT
The XMLHttpRequest object uses ____ to exchange data between a client computer and a Web server. A) HTTP B) FTP C) HTTPS D) SSL
A) HTTP
JSON stands for the following: A) JavaScript Object Notation B) Java Source Object Notation C) JavaScript Open Network D) jQuery Source Object Notation
A) JavaScript Object Notation
What is the correct JavaScript syntax to change the content of the HTML element below? <p id="demo">This is a demonstration.</p> A) document.getElementById("demo").innerHTML = "Hello World!"; B) #demo.innerHTML = "Hello World!"; C) document.getElement("p").innerHTML = "Hello World!"; D) document.getElementByName("p").innerHTML = "Hello World!";
A) document.getElementById("demo").innerHTML = "Hello World!";
At the core of DHTML is ____. A) JavaScript B) DOM C) XML D) CSS
B) DOM
This is one of the most common types of HTTP requests. This method is used for standard web page requests to a server. A query string or form data can be included or appended to the URL request sent to the server. A) PUT B) GET C) POST D) TRACE
B) GET
The ____ property of the Image object allows JavaScript to dynamically change an image. A)img B)src C)path D)file
B) Src
A(n) ____ is a software component that resides on a Web server. A) AJAX request B) Web service C) HTTP service D) DHTML service
B) Web service
Which of the following is the correct syntax for accessing the value of the href attribute for the third a element in a document? A) document.getElementByTagName("href")[3] B) document.getElementByTagName("a")[2].href C) document.getElementByID=d("a").href D) document.getElementByTagName("a")[3].href
B) document.getElementByTagName("a")[2].href
The ____ method returns an array of elements that match a specified tag name. A) getElementsById() B) getElementsByTagName() C) getElementsByTagId() D) getElementsByName()
B) getElementsByTagName()
Which sign does jQuery use as a shortcut for jQuery? A) the & sign B) the $ sign C) the % sign D) the ? sign
B) the $ sign
Look at the following selector: $("div p"). What does it select? A) The first p element inside a div element B) All p elements inside a div element C) All div elements with a p element D) None of these.
C) All div elements with a p element
Every Web page is identified by a unique address called the ____. A) host string B) host C) URL D) HTTP
C) URL
Look at the following selector: $("p #intro"). What does it select? A)All p elements with id="intro" B)All p elements with class="intro" C)The p element with id="intro" D)All intro elements with id="p"
C)The p element with id="intro" (only one thats singular)
Which sign does jQuery use as a shortcut for jQuery? A) $(.*) B) $(#all) C) $("all") D) $("*")
D) $("*")
What is the jQuery statement that will hide all <p> elements in an HTML document? A) None of these B) $("#p").hide() C) $(".p").hide() D) $("p").hide()
D) $("p").hide()
Which of the following features does jQuery library contain? A) HTML/DOM manipulation B) CSS manipulation C) Effects and animations D) All are true
D) All are true
The term ____ refers to the application, usually a Web browser, which makes the request. A) HTTP server B) host C) HTTP URL D) HTTP client
D) HTTP client
Which of the following is the correct syntax for accessing an element with the id value headline? A) document.getElementByID("headline") B) document.getElementsById("headline") C) document.getElementById(headline) D) document.getElementById("headline")
D) document.getElementById("headline")
A(n) ____ request stops the processing of the JavaScript code until a response is returned from the server. A) asynchronous B) global C) domain D) synchronous
D) synchronous
"DHTML" refers to a single technology. T/F?
False
The following example returns a list of all elements where the id="intro" var x = document.getElementsByClassName("intro"); T/F?
False
The following selector: $("div") selects only the first div element in the HTML document. t/f
False
What scripting language is jQuery written in?
Javascript
The DOM is a W3C (World Wide Web Consortium) standard. T/F?
True
The ability for one Web server to access Web pages and data on another Web server is the foundation of the World Wide Web. t/f
True
The getElementsByName() method always returns an array, even if there is only one element in the document with a matching name attribute. t/f?
True
The innerHTML property is used to get or replace the content of an HTML element. t/f?
True
The XMLHttpRequest object has a property called STATUS. If the STATUS is 404, then the response from the server is ready and everything is okay. t/f
false
The following selector: $("div") only selects the first div element in the HTML document. t/f
false
The following statement finds all of the <span> elements in the HTML document: var x = document.getElementsByTagName("p"); t/f?
false
XML is required for data interchange between client and server in an Ajax application. t/f
false
AJAX primarily relies on JavaScript and HTTP requests to exchange data between a client computer and a Web server. t/f
true
An HTTP response message returns to the client the message and the status code. If the status code is 200, then the request was successful. t/f
true
Each element on a Web page is represented in the HTML DOM by its own object. t/f?
true
JSON is a syntax for storing and exchanging data. It is considered a lightweight data interchange format and a subset of JavaScript. It is considered easy to use and understand and is language independent. t/f
true
The following code does the following: when a user clicks on a button, the element with id="test" will be hidden. $(document).ready(function(){ $("button").click(function(){ $("#test").hide(); }); }); t/f?
true
With AJAX, the JavaScript does not have to wait for the server response, but can instead execute other scripts while waiting for the server response. t/f
true
jQuery uses CSS selectors to select elements t/f?
true