QUESTION 111

DRAG DROP

You create the following JavaScript code:

 

clip_image002

 

You must complete the ShowCanWeAfford() function:

 

clip_image004Display the message Denied! If the PaymentAmount variable is greater than 500.

clip_image004[1]Display the message Approved! If the PaymentAmount variable is less than 300.

clip_image004[2]Display the message Approved with caution! If the PaymentAmount variable is less than 500 and greater than 300.

 

You need to add statements to the ShowCanWeAfford() JavaScript function to meet the requirements.

 

Which three actions should you perform in sequence? (Develop the solution by selecting the required code segments and arranging them in the correct order.)

 

clip_image006

 

Correct Answer:

clip_image008

 

 

QUESTION 112

DRAG DROP

You have a webpage that includes the following markup:

 

clip_image010

 

An XML file named message.xml resides on a web server. The structure of the file is as follows:

 

clip_image012

 

You are developing a code-based solution to parse the contents of the XML file and display the information on the page.

 

The solution must work on both modern and older browsers.

 

You need to display the information from the XML file onto the page.

 

How should you create the JavaScript code? (Develop the solution by selecting the required code segments and arranging them in the correct order. You may not need all of the code segments.)

 

clip_image014

 

Correct Answer:

clip_image016

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 113

HOTSPOT

You review a web form that contains the following markup and code:

 

clip_image018

 

You need to ascertain how the webpage responds when it loads and how it reacts to user actions.

 

For each statement in the table, select Yes if the code segment above causes the page to behave as described. Select No if it does not. Make only one selection in each column.

 

clip_image020

 

Correct Answer:

clip_image022

 

QUESTION 114

HOTSPOT

You test a webpage that contains the following JavaScript code:

 

clip_image024

 

The webpage also contains the following markup:

 

clip_image025

 

You need to ascertain how the webpage responds when the user enters characters and then clicks the add and divide buttons.

 

For each statement in the table, select Yes if the action causes the webpage to behave as described. Select No if it does not. Make only one selection in each column.

 

clip_image027

 

Correct Answer:

clip_image029

 

 

QUESTION 115

An HTML page contains no embedded JavaScript or CSS code. The body of the page contains only the following line of code.

 

<p id=”test”>test</p>

 

A CSS style sheet must be applied dynamically. The style must visibly change the appearance of the paragraph on the page.

 

You need to apply a style the paragraph.

 

Which line of code should you use?

 

A.

document.getElementById(“test”).style.border = “0”;

B.

document.getElementById(“test”).style.position = “static”;

C.

document.getElementById (“test”).style.padding = “15px”;

D.

document.getElementById(“test”).style.top = “5px”;

 

Correct Answer: C

Explanation:

The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.

 

 

QUESTION 116

You develop an HTML5 web application. The web application contains a form that allows users to enter only their month of birth.

 

The value that the users enter must be numbers between 1 and 12, inclusive.

 

You need to implement the form element for the month of birth.

 

Which element should you use?

 

A.

<input type=”time” options=”month” />

B.

<input types=”submit” value=”month” />

C.

<input type=”range” min=”1″ max=”12″ />

D.

<input type=”month” itemscope=”numeric” />

 

Correct Answer: C

Explanation:

Example:

</head>

<body>

<input type=”range” name=”rangeInput” min=”0″ max=”100″ onchange=”updateTextInput(this.value);”>

<input type=”text” id=”textInput” value=””>

</body>

</html>

 

 

QUESTION 117

You are developing an HTML5 web application for an architectural company that displays architectural blueprints.

 

The application must:

 

clip_image004[3]Display the blueprints at different zoom levels without loss of detail

clip_image004[4]Print the blueprints without loss of detail

clip_image004[5]Work from only one source file per blueprint

 

You need to ensure that blueprints display according to the requirements.

 

Which HTML5 element should you use?

 

A.

CANVAS

B.

SAMP

C.

SVG

D.

AREA

 

Correct Answer: C

 

 

QUESTION 118

You develop an HTML5 application that allows users to upload files from their local computers.

 

The user interface must remain responsive during the upload.

 

You need to implement the file upload functionality for the application.

 

Which two actions should you perform? (Each correct answer presents a complete solution. Choose two.)

 

A.

Use an HTML form with a file type INPUT element that targets a hidden IFRAME element.

B.

Use a file type INPUT element, and then use the Web Storage API to upload the file.

C.

Use a FormData object and upload the file by using XMLHttpRequest.

D.

Register the file protocol by using protocol handler registration API and then upload the file by using XMLHttpRequest.

E.

Use the FileSystem API to load the file, and then use the jQuery post method to upload the file to the server.

 

Correct Answer: BD

Explanation:

B:

Example (notice the web storage api upload.aspx):

<!DOCTYPE html>

<html>

<head>

<title>Upload Files using XMLHttpRequest – Minimal</title> </head>

<body>

<form id=”form1″ enctype=”multipart/form-data” method=”post” action=”Upload.aspx”> <div class=”row”>

<label for=”fileToUpload”>Select a File to Upload</label><br /> <input type=”file” name=”fileToUpload” id=”fileToUpload” onchange=”fileSelected();”/> </div>

<div id=”fileName”></div>

<div id=”fileSize”></div>

<div id=”fileType”></div>

<div class=”row”>

<input type=”button” onclick=”uploadFile()” value=”Upload” /> </div>

<div id=”progressNumber”></div>

</form>

</body>

</html>

 

D:

* Because we’re using XMLHttpRequest, the uploading is happening in the background. The page the user is on remains intact. Which is a nice feature to have if your business process can work with it.

 

* The XMLHttpRequest object has gotten a facelift in the Html5 specifications. Specifically the XMLHttpRequest Level 2 specification (currently the latest version) that has included the following new features:

 

Handling of byte streams such as File, Blob and FormData objects for uploading and downloading

Progress events during uploading and downloading Cross-origin requests

Allow making anonymous request – that is not send HTTP Referer The ability to set a Timeout for the Request

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

< font style="font-size: 10pt" color="#000000"> 

 

 

 

 

 

 

QUESTION 119

You are developing a web application that can function when users are not connected to the Internet.

 

You need to check the Internet connectivity status of a user’s browser.

 

Which method should you use?

 

clip_image031

 

< td style="border-top-style: none; border-left-style: none; background: white; border-bottom-style: none; padding-bottom: 0cm; padding-top: 0cm; border-right-style: none; padding-left: 0cm; padding-right: 0cm" valign="top" width="26">

C.

A.

Option A

B.

Option B

Option C

D.

Option D

 

Correct Answer: D

Explanation:

navigator.onLine is a property that maintains a true/false value (true for online, false for offline). This property is updated whenever the user switches into “Offline Mode” by selecting the corresponding menu item

 

 

QUESTION 120

You are creating a page that contains detailed employee information for a company portal. The page uses a jQuery library. The page contains a hidden button named btnEdit that is defined by the following code.

 

<button id=”btnEdit” style=”display: none;n>Edit</button>

 

The button is not displayed by default.

 

The button must be displayed only if the user is logged on.

 

You need to add code to the document.ready() function to meet the requirements for the button.

 

Which line of code should you use?

 

A.

$ (`#btnEdit’).appear ();

B.

$ (`#btnEdit’).visible = true;

C.

$ (`#btnEdit’).show();

D.

$ (`#btnEdit’).Visible();

 

Correct Answer: C

Explanation:

With no parameters, the .show() method is the simplest way to display an element:

$( “.target” ).show();

 

 

Free VCE & PDF File for Microsoft 70-480 Real Exam

Instant Access to Free VCE Files: MCSE|MCSA|MCITP…
Instant Access to Free PDF Files: MCSE|MCSA|MCITP…