You have a JavaScript function that is passed as a FileReader Object. In the function, you call the
FileReader's readAsArrayBuffer method.
To process the file contents as an array of bytes, which type of object should you create? - (correct
Answer) - UintBArray
You need to draw a solid blue rectangle onto a canvas.
What code should you use? - (correct Answer) - context.fillStyle = "blue";
context.fillRect(0, 0, 50, 50);
you need to draw onto a Hypertext Markup Language (HTML) 5 canvas element named "theCanvas" by
using JavaScript.
What code should you use? - (correct Answer) - var content =
document.getElementById("theCanvas").getContext("2d")
You have an English-language Hypertext Markup Language (HTML) application that uses a Cascading
Style Sheet (CSS) grid for layout.
Which CSS property should be set to the value "stretch" to make an HTML element fill the width of a cell
in the grid? - (correct Answer) - grid-column-align
You use the following code to make a Geolocation request of the browser:
navigator.geolocation.getCurrentPosition(gotPositionSuccess, gotPositionFailed);
How do you display the current altitude in meters to the user - (correct Answer) - function
gotPositionSuccess(coordinates) {
var altitude = document.getElementById("altitude");
altitude.innerHTML = coordinates.latitude;
,}
Your Hypertext Markup Language (HTML) application uses a flexbox to arrange three div elements. The
first two div elements have a box-flex Cascading Style Sheet (CSS) property set to the value 20. The third
div element should use 50% of the parent containers width.
what value should you use for the box-flex CSS property for the third div element? - (correct Answer) - 40
Which two HTML5 items should be used to construct a global navigator for a web site? (Choose two.) -
(correct Answer) - <nav> element
href attribute
You have a Hypertext Markup Language (HTML) 5 application designed to run on Microsoft Internet
Explorer 10. You need to program your application to handle mouse, touch, and pen input.
Which event should your JavaScript code handle to process a mouse click or a touch- or pen-tap? -
(correct Answer) - MSPointerDown
The globalCompositeOperation defines how images placed on a canvas will interact when they share the
same canvas areas.
Which statement describes the Destination-in operation? - (correct Answer) - The destination image is
displayed where both source and destination are opaque. Other regions are transparent.
You have a Hypertext Markup Language (HTML) 5 application that uses a grid layout. Your layout requires
three columns. The first and last column should be 100 pixels wide, and the middle column should have
100 percent of the remaining width.
Which Cascading Style Sheet (CSS) property definition will satisfy these requirements? - (correct Answer)
- grid-columns: 100px 100fr 100px
To execute JavaScript as a background (asynchronous) task, which Hypertext Markup Language (HTML) 5
Application Programming Interface (API) should you use? - (correct Answer) - WebWorker
You need to make an asynchronous Ajax request to the server to fetch a product description contained in
the "product-c.txt". You have already completed the following code:
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
, if (xhr.readyState == 4 & readystate.status == 200) {
document.getElementById("productDescription").innerHTML = xhr.responseText;
}
}
what block of code should you write next? - (correct Answer) - xhr.open("GET", "product-c.jpg", true);
xhr.send();
You want to gradually and smoothly change the position of a div element over a period of 1500
milliseconds.
What method should you use? - (correct Answer) - window.requestAnimationFrame
Hold - (correct Answer) - Used to provide contextual menus similar to a right mouse click on a PC
Pan - (correct Answer) - Used to reorder items in a list
Pinch - (correct Answer) - Used to minimize content
Tap - (correct Answer) - Used to emulate a left mouse click
Your web application needs to determine if updated files are currently being downloaded from the
server hosting the application. You add the following code to your application:
Window.applicationCache.addeventlistener("EVENT", Function(e) {
Alert("New or updated file Downloading");
},
False);
Which event should you use to detect that a download of a new or updated file from the server is
occurring? (Substitute the word "EVENT" width the appropriate word.) - (correct Answer) - Progress
You have a Hypertext Markup Language (HTML) 5 application that uses the following Cascading Style
Sheet (CSS) grid-based layout:
#grid {