Week 3 Quiz

¡Supera tus tareas y exámenes ahora con Quizwiz!

How an HTML page can reference a JavaScript file? <srip src="app.js"></srip> <link src="app.js" /> app.js <a href="app.js"> *note: srip = script, quizlet would not save if called script

<srip src="app.js"></srip> *note: real answer is "script" not "srip", quizlet would not save it if named script

What HTML element allows for internal CSS to be added to the HTML page? <style> <css> <head> <body>

<style>

What HTML element can hold JavaScript? JavaScript> js> scripting> script> *note: quizlet would not save if tag was completed, there is a < infront if each answer

script> *note: quizlet would not save if tag was completed, there is a < infront if the answer

AJAX Ready States Match the AJAX ready state code to its correct value. • value AJAX ready state code 0 UNSENT - Client has been created. open() not called yet. 1 OPENED - open() has been called. 2 HEADERS_RECEIVED - send() has been called, and response headers and status are available. 3 LOADING - Downloading; responseText holds partial data. 4 DONE - The operation is complete. • •

• Question Correct Answer 0 UNSENT - Client has been created. open() not called yet. 1 OPENED - open() has been called. 2 HEADERS_RECEIVED - send() has been called, and response headers and status are available. 3 LOADING - Downloading; responseText holds partial data. 4 DONE - The operation is complete. • •

How would I select the element if its id were "intro" using CSS? • *intro • #intro • .intro • intro •

• #intro •

Which of the following is a way to associate styles with your HTML document? • Embedded CSS - The <style> Element • Inline CSS - The style Attribute • Both of the above. • None of the above. •

• (Embedded CSS - The <style> Element • Inline CSS - The style Attribute) • Both of the above. •

How would I select all elements with the class "intro" using CSS? • #intro • class="intro" • .intro • intro •

• .intro •

Which of the following is the correct file extension for external JavaScript files? • .js • .java • .jscript • .css •

• .js •

How do you insert a comment in a CSS file? • /* this is a comment */ • this is a comment • // this is a comment // • // this is a comment •

• /* this is a comment */

Which of these is an example of a multi line Comment in JavaScript? • *This comment has<br/> more than one line* • <!--This comment has <br/> more than one line --> • //This comment has <br/>more than one line// • /*This comment has <br/>more than one line*/ •

• /*This comment has <br/>more than one line*/ •

Which of these is an example of a single line JavaScript comment? • **This is a comment • <!-- This is a comment --> • *This is a comment* • //this is a comment •

• //this is a comment •

Javascript expressions Select all expressions which evaluate to true. Assume these are being used in an if statement. • NaN == NaN • 5 === '5' • 5 == '5' • null == null • 0 • '' • 'hello' • 32767 •

• 5 == '5' • null == null •

Arrays in Java are different than those in JavaScript in that • Array literals are represented with curly brackets rather than square brackets. • Arrays can hold only values of a single type. • Arrays have a size defined on creation which cannot be modified. • All of these things. •

• All of these things. •

What is a servlet session? • An object representing state information for the current user. • An object representing information to be saved to a database. • An object representing application wide state. • An object that every user shares. •

• An object representing state information for the current user. •

How would you get the 1st element in an array in JavaScript? • Array{0} • Array_0 • Array(1) • Array[0] Array[1] • Array@1

• Array[0] • Explanation : An array is denoted by square brackets [], and starts at index 0. •

What does AJAX stand for? • Asynchronous JavaScript and XML • Altered JavaScript and XML • Asynchronous Java and XML • Asynchronous JavaScript and XHTML •

• Asynchronous JavaScript and XML •

Which of the following is a valid type of function javascript supports? • named function • anonymous function • Both of the above. None of the above. •

• Both of the above. Explanation : A function in JavaScript can be either named or anonymous.

What is the difference between request.getRequestDispatcher forward and ... What is the difference between request.getRequestDispatcher forward and response sendRedirect? • Forward is performed internally by the client • Browser is completely unaware that a forward has taken place, so its original URL remains intact • Forward is marginally slower than a redirect, since it requires two browser requests, not one • With forward, objects placed in the original request scope are not available to the second request •

• Browser is completely unaware that a forward has taken place, so its original URL remains intact •

What is the purpose of CSS? • CSS is a type of JavaSCript used to modify the appearance of the virtual DOM. • CSS replaces standard HTML. • CSS is used for modifying the DOM. • CSS is used for changing the styles, or appearance, of HTML elements. •

• CSS is used for changing the styles, or appearance, of HTML elements. •

CSS Stands for..... • Cascading Style Sheets. • Cool Style Sheets. • Cosmopolitan Sophisticated Styles. • Computer Style Sheets. •

• Cascading Style Sheets. •

What is a cookie? • A tasty treat. • The format of data submitted from the client using a form. • Data provided by the server which is automatically included in future requests. • Data shared by all users of an application. •

• Data provided by the server which is automatically included in future requests. •

Which is not a part of the servlet class/interface hierarchy? • Servlet • HttpServlet • DispatcherServlet • GenericServlet •

• DispatcherServlet •

* • All HTML tags come in pairs. • TRUE • FALSE •

• FALSE •

JavaScript statements end with a period. • TRUE • FALSE •

• FALSE •

HTML stands for HyperText Messaging Language • True • False •

• False •

JavaScript vs Java Java is short for JavaScript • False • True •

• False •

Which of the following true about the contents of HTML documents • HTML documents are encrypted. • HTML documents are not human readable. • HTML documents require specialized software to open. • HTML documents are just plain text. •

• HTML documents are just plain text. •

The object returned to application server by the servlet is? • HttpResponse • HttpServletResponse • JavaServletResponse • HttpServletRequest •

• HttpServletResponse •

JavaScript general question What is not true about JavaScript? • JavaScript is a scripting language • It is object-based, lightweight and cross platform • It is widely used for client side validation • JavaScript relies on server-side technologies to manage cookies • Able to build interactivity into otherwise static HTML pages • Embedded in Netscape, Internet Explorer, and other web browsers •

• JavaScript relies on server-side technologies to manage cookies •

What does MVC stand for? • Model View Controller • Modularized Visible Controller • Mapping View Controller • Model Vector Controller •

• Model View Controller •

CSS Declarations contain which of the following? • Style definitions. • Name-value pairs. • JavaScript. • HTML. •

• Name-value pairs. •

Java and JavaScript are related in that they are... • The same language. • Made by the same organization. • Designed for the same purpose. • None of these things. •

• None of these things. •

Which of the follow are primitive data types in JavaScript? Choose Six. • Number • String Null • Undefined • Boolean Symbol Array Object Char

• Number • String • Null • Undefined • Boolean Symbol • Explanation : An array is a form of an object, and is not a primitive. Though a data type, object is not a primitive. char is not a data type in JavaScript. •

What is the difference between ServletConfig and ServletContext? What is the difference between ServletConfig and ServletContext? • ServletConfig is available to all servlets. ServletContext is available to only one servlet. • ServletContext is available to all servlets. ServletConfig is available to only one servlet. • ServletConfig object is only available in a JSP. • ServletContext object is only available in a Servlet and not a JSP. •

• ServletContext is available to all servlets. ServletConfig is available to only one servlet. •

At what point is an AJAX responseText ready to be handled? • Status Code 100 and readyState 1 • Status Code 200 and readyState 2 • Status Code 200 and readyState 4 • Status Code 300 and readyState 4 •

• Status Code 200 and readyState 4 •

AWS - S3 Static Web Hosting S3 Buckets can be used to host websites without managing a server. • TRUE • FALSE •

• TRUE •

In JavaScript, a closure is an inner function that has access to its outer function's scope, even after the outer function has returned. • TRUE • FALSE •

• TRUE •

The HTML DOM is an object based interface that allows JavaScript and other entities manipulate and create HTML elements dynamically. • TRUE • FALSE •

• TRUE •

You are allowed to have more than one script tag on the page for multiple JavaScript references. • TRUE • FALSE •

• TRUE •

Who calls the constructor of a servlet? • The Container • The session object. • The client side code. • The server. •

• The Container •

Which of the following describes the Front Controller pattern correctly? • This pattern is used to separate low level data accessing API or operations from high level business services. • This pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler. This pattern is used when we want to do some pre-processing / post-processing with request or response of the application. • This pattern is used when we want to locate various services using JNDI lookup. •

• This pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler. Explanation : Front Controller pattern, is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler. •

This object is used to make Ajax calls. • HttpRequest • XMLRequest • Request • XMLHttpRequest •

• XMLHttpRequest •

Jackson is • part of the JavaEE standard library. • used to serialize and deserialize Java objects to bytecode. • used to marshall and unmarshal JavaScript to JSON. • a Java library for marshaling and unmarshaling objects to JSON. •

• a Java library for marshaling and unmarshaling objects to JSON. •

A CSS selector is • a special keyword in CSS • the name of a styling option which we can modify. • an assignable value for a property. • a string of text used to target elements in an HTML document •

• a string of text used to target elements in an HTML document •

Which is the correct CSS syntax? • body {color: black;} • {body:color=black;} • {body;color:black;} • body:color=black; •

• body {color: black;} •

What is the correct JavaScript syntax to change the content of the HTML element? • #demo.innerHTML = "Hello World!"; • document.getElementByName("demo").innerHTML = "Hello World!"; • document.getElementById("demo").innerHTML = "Hello World!"; • document.getElement("demo").innerHTML = "Hello World!"; •

• document.getElementById("demo").innerHTML = "Hello World!"; •

You can use the ____ element in web.xml to send a user to a certain page based on exception class types or HTTP status codes. You can use the ____ element in web.xml to send a user to a certain page based on exception class types or HTTP status codes. • error-page • error • error-handler • None of the above. •

• error-page •

Are HTML tags case sensitive? • true • false

• false Explanation : No! HTML tags are not case sensitive.

How do you create a function in JavaScript? • var function myFunction() • function=myFunction() • function:myFunction() • function myFunction() •

• function myFunction() •

Select all h1 elements in CSS • h1{ } • h1.all{ } • all.h1{ } • Not possible •

• h1{ } •

JavaScript is interpreted • in a third party program that interprets the code outside of the server • in a third party program that interprets the code outside of the browser. • on the server. • in the browser. •

• in the browser. •

If there are three css rules identifying the same element, in what order will those elements take precedence? (from most to least) • internal, inline, external • inline, internal, external • external, internal, inline • inline, external, internal •

• inline, internal, external •

JavaScript events Which is not a JavaScript event? • onchange • onload • onhover • onclick • None of these •

• onhover •

What is the method signature of the doPost method? What is the method signature of the doPost method? • public void doPost(HttpServletRequest request, HttpServletResponse response) • protected void doPost(HttpServletRequest request, HttpServletResponse response) • public PrintWriter doPost(HttpServletRequest request) • protected HttpServletResponse doPost(HttpServletRequest request) •

• protected void doPost(HttpServletRequest request, HttpServletResponse response) •

Which of the following code is used to get a HTTP Session object in servlets? • request.getSession() response.getSession(); • new Session() • None of the above. •

• request.getSession() Explanation : request.getSession() is used to get a HTTP Session object in servlets. •

What functions actually sends the AJAX request? • send() • sendRequest() • getResponse() • getResource() •

• send() •

This servlet lifecycle method is called once for every request issued to the servlet This servlet lifecycle method is called once for every request issued to the servlet • init • service • destroy •

• service •

Which tags are used to register a servlet in web.xml? Which tags are used to register a servlet in web.xml? • servlet, servlet-name, servlet-class • servlet, servlet-class • servlet, servlet-name • servlet •

• servlet, servlet-name, servlet-class •

Which of the following code is used to get an attribute in a HTTP Session object in servlets? • session.getAttribute(name) session.alterAttribute(name) • session.updateAttribute(name) • None of the above. •

• session.getAttribute(name) Explanation : session.getAttribute() returns the object bound with the specified name in this session, or null if no object is bound under the name. •

A CSS property is • a special keyword in CSS • the name of a styling option which we can modify. • an assignable value for a property. • a string of text used to target elements in an HTML document •

• the name of a styling option which we can modify. •

Is HTML5 backward compatible with old browsers? • true false •

• true Explanation : Yes! HTML5 is designed, as much as possible, to be backward compatible with existing web browsers. •

which of these would be an example of writing a correct JavaScript array? • var myArr = ("sample", "words") • var myArr = "sample", "words" • var myArr = [1:"sample",2: "words"] • var myArr = ["sample", "words"] •

• var myArr = ["sample", "words"] •

Which HTML tag would you use to allow the user to navigate to a different page? • <link> • <a> • <button> • <nav> •

• <a> •

* The following HTML will render a list of items separated by bullet points • <li> <ul>first</ul> <ul>second</ul> <ul>third</ul> </li> • <ol> <li>first</li> <li>second</li> <li>third</li> </ol> • <ul> <li>first</li> <li>second</li> <li>third</li> </ul> • <li> <ol>first</ol> <ol>second</ol> <ol>third</ol> </li> •

• <ul> <li>first</li> <li>second</li> <li>third</li> </ul> •

Which of the following is a component of CSS style rule? • Selector • Property • Value • All of the above. Explanation : All of the above options are correct. •

• All of the above. •

Which of the following is correct about CSS? • CSS is used to control the style of a web document in a simple and easy way. • CSS is the acronym for "Cascading Style Sheet". • You can write CSS once and then reuse same sheet in multiple HTML pages. • All of the above.

• All of the above. •

* Which of the following browsers support HTML5 in its latest version? • Apple Safari • Google Chrome • Mozilla Firefox • Opera • All of them. • None of the above. •

• All of them. Explanation : All modern browsers support HTML5.

The deployment descriptor is • Used to specify project dependencies. • Used to configure native Java applications. • pom.xml • Used to configure a web application project for deployment on a server. •

• Used to configure a web application project for deployment on a server. •

AWS - S3 bucket permissions. How do we control who can read an object in an S3 bucket. • We create a Policy to the bucket that specifies permissions. • We assign an IAM role to our bucket. • We assign an IAM user to our bucket. • Everything in the bucket always has public read access.

• We create a Policy to the bucket that specifies permissions.


Conjuntos de estudio relacionados

ACE Group Fitness Instructor chapter 3

View Set

2021 Private Pilot Test Prep (Ch 4 & 5, ALL & AIR ONLY)

View Set

Info Sec & Network Quiz Chapter 8

View Set

Nclex review: Pneumonia and Respiratory Meds

View Set

Unit 9 Life insurance underwriting and policy issue

View Set