最新的Microsoft Programming in HTML5 with JavaScript and CSS3 - 070-480免費考試真題
問題1
You are developing an e-commerce website. Users place products into a shopping cart.
You need to ensure that the shopping cart data is available between browser sessions.
Which object should you use to store the shopping cart data?
You need to ensure that the shopping cart data is available between browser sessions.
Which object should you use to store the shopping cart data?
正確答案: B
說明:(僅 VCESoft 成員可見)
問題2
You develop a web application by using jQuery. You develop the following jQuery code: (Line numbers are included for reference only.)

The web application exposes a RESTful web API that has an endpoint of/product/create.
You need to create a new product by using AJAX.
Which code segment should you insert at line 05?


The web application exposes a RESTful web API that has an endpoint of/product/create.
You need to create a new product by using AJAX.
Which code segment should you insert at line 05?

正確答案: B
說明:(僅 VCESoft 成員可見)
問題3
You are developing a web page that includes the following HTML.
<span id = "myTextSpan" class = "redText"> Hello There! </span>
The font color of text inside the span must be red.
You need to develop the web page to meet the requirement.
Which two CSS segments will achieve the goal? (Each correct answer presents a complete solution. Choose two.)

<span id = "myTextSpan" class = "redText"> Hello There! </span>
The font color of text inside the span must be red.
You need to develop the web page to meet the requirement.
Which two CSS segments will achieve the goal? (Each correct answer presents a complete solution. Choose two.)

正確答案: C,D
說明:(僅 VCESoft 成員可見)
問題4
You are developing an HTML5 web application that displays customer mailing address information.
The application loads addresses from a web service by using AJAX. The following code defines a Customer object and loads address data.

You need to implement the loadAddress function.
Which code segment should you use?

The application loads addresses from a web service by using AJAX. The following code defines a Customer object and loads address data.

You need to implement the loadAddress function.
Which code segment should you use?

正確答案: C
問題5
You are implementing an HTML page that uses a custom sans-serif font. The CSS statement for the page is as follows.

Some users report that text is displayed in the default font for the browser.
You need to modify the CSS statement to ensure that the content is displayed with the custom font.
What should you do? (To answer, select the appropriate options from the drop-down lists in the answer area.)



Some users report that text is displayed in the default font for the browser.
You need to modify the CSS statement to ensure that the content is displayed with the custom font.
What should you do? (To answer, select the appropriate options from the drop-down lists in the answer area.)


正確答案:

Explanation

Using The Font You Want
In the CSS3 @font-face rule you must first define a name for the font (e.g. myFirstFont), and then point to the font file.
To use the font for an HTML element, refer to the name of the font (myFirstFont) through the font-family property:
Example
@font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
}
div {
font-family: myFirstFont;
}
Note:
* CSS3 Web Fonts - The @font-face Rule
Web fonts allow Web designers to use fonts that are not installed on the user's computer.
When you have found/bought the font you wish to use, just include the font file on your web server, and it will be automatically downloaded to the user when needed.
Your "own" fonts are defined within the CSS3 @font-face rule.
* TrueType Fonts (TTF)
TrueType is a font standard developed in the late 1980s, by Apple and Microsoft. TrueType is the most common font format for both the Mac OS and Microsoft Windows operating systems.
Reference: CSS3 Web Fonts
問題6
You are developing a web form that includes the following code.

When a user selects the check box, an input text box must be added to the page dynamically.
You need to ensure that the text box is added.
Which function should you use?


When a user selects the check box, an input text box must be added to the page dynamically.
You need to ensure that the text box is added.
Which function should you use?

正確答案: A
說明:(僅 VCESoft 成員可見)
問題7
You have the following code:

The web service returns a JSON object that contains two properties named Description and FileName.
The PersonImage object must meet the following requirements:
* Create an object that represents an image that will be displayed.
* Set the image properties from the values that are returned by the web service.
* Expose the image as a property of the PersonImage object.
You need to insert code at line 13 to complete the implementation of the PersonImage object.
Which three actions should you perform in sequence to complete the implementation? (Develop the solution by selecting the required code segments and arranging them in the correct order.)


The web service returns a JSON object that contains two properties named Description and FileName.
The PersonImage object must meet the following requirements:
* Create an object that represents an image that will be displayed.
* Set the image properties from the values that are returned by the web service.
* Expose the image as a property of the PersonImage object.
You need to insert code at line 13 to complete the implementation of the PersonImage object.
Which three actions should you perform in sequence to complete the implementation? (Develop the solution by selecting the required code segments and arranging them in the correct order.)

正確答案:

Explanation
Box 1: var img = document.createElement('img');
Box 2: img:alt = image.Description;
img src = image.FileName;
Box 3: return this.img;
Note:
* Image Object
The Image object represents an embedded image.
For each <img> tag in an HTML document, an Image object is created.
Notice that images are not technically inserted into an HTML page, images are linked to HTML pages. The
<img> tag creates a holding space for the referenced image.
* Image Object Properties include
alt, Sets or returns the value of the alt attribute of an image
src, Sets or returns the value of the src attribute of an image
問題8
You are developing an HTML5 page named main.html. The JavaScript code for the main page is located in a file named myApp.js.
You need to create a web worker and instantiate it from main.html.
Where should you place the web worker code?
You need to create a web worker and instantiate it from main.html.
Where should you place the web worker code?
正確答案: B
說明:(僅 VCESoft 成員可見)
問題9
You are creating a custom CSS3 style.
You have the following requirements to complete the style:
* Box1 has a red outline.
* Box1 contains box2, and box2 must remain inside box1
* Box2 must have a green to black gradient.
* Box2 must be surrounded by white space.
The style resembles the following diagram:

You need to add the CSS3 code to the styles.
How should you complete the relevant code? (To answer, select the appropriate code segment in each drop-down list in the answer area.)


You have the following requirements to complete the style:
* Box1 has a red outline.
* Box1 contains box2, and box2 must remain inside box1
* Box2 must have a green to black gradient.
* Box2 must be surrounded by white space.
The style resembles the following diagram:

You need to add the CSS3 code to the styles.
How should you complete the relevant code? (To answer, select the appropriate code segment in each drop-down list in the answer area.)


正確答案:

Explanation

* border: 1px solid #f00;
a red border 1 pixel thick.
* background-image: linear-gradient(to bottom, green,black);
Linear Gradients (goes down/up/left/right/diagonally).
Starts at the top with green and goes to bottom with black.
* margin: 10px 10px 10px 10px;
The CSS margin properties define the space around elements.
The top, right, bottom, and left margin can be changed independently using separate properties.
Incorrect:
* border-color: red;
will not display any border
* Radial Gradients (defined by their center).
問題10
You are developing an HTML5 web application and are styling text.
You need to use the text-transform CSS property.
Which value is valid for the text-transform property?
You need to use the text-transform CSS property.
Which value is valid for the text-transform property?
正確答案: B
說明:(僅 VCESoft 成員可見)
問題11
You are creating a web page that contains a canvas with text.
The page contains the following JavaScript code. (Line numbers are included for reference only.)

The text on the canvas must rotate 90 degrees when a user clicks a button on the page.
You need to ensure that the text rotates when the user clicks the button.
Which line of code should you add at line 03?
The page contains the following JavaScript code. (Line numbers are included for reference only.)

The text on the canvas must rotate 90 degrees when a user clicks a button on the page.
You need to ensure that the text rotates when the user clicks the button.
Which line of code should you add at line 03?
正確答案: C
說明:(僅 VCESoft 成員可見)
問題12
You are developing a form that captures a user's email address by using HTML5 and jQuery.
The form must capture the form elements as a string.
You need to implement this functionality.
How should you develop the form? (To answer, drag the appropriate code segment to the correct target or targets in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

The form must capture the form elements as a string.
You need to implement this functionality.
How should you develop the form? (To answer, drag the appropriate code segment to the correct target or targets in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

正確答案:

Explanation

* The serialize() method creates a URL encoded text string by serializing form values.
You can select one or more form elements (like input and/or text area), or the form element itself.
The serialized values can be used in the URL query string when making an AJAX request.
Example: $("form").serialize());
* decodeURIComponent
The decodeURIComponent() function decodes a URI component.
Return Value:A String, representing the decoded URI
Incorrect:
Not decodeURI:
decodeURI is intended for use on the full URI.
decodeURIComponent is intended to be used on .. well .. URI components that is any part that lies between separators (; / ? : @ & = + $ , #).
Reference: jQuery serialize() Method
問題13
You are developing a form that captures a user's email address by using HTML5 and jQuery.
The form must capture the email address and return it as a query string parameter. The query string parameter must display the @ symbol used in the email address.
You need to implement this functionality.
How should you develop the form? (To answer, select the appropriate options from the drop-down lists in the answer area.)

The form must capture the email address and return it as a query string parameter. The query string parameter must display the @ symbol used in the email address.
You need to implement this functionality.
How should you develop the form? (To answer, select the appropriate options from the drop-down lists in the answer area.)

正確答案:

Explanation

* serialize()
Encode a set of form elements as a string ready for submission.
decodeURIComponent
* To decode the string, PHP offers the urldecode() function.
?
echo urldecode('name%40website.com'); //restores "[email protected]"
Reference: JavaScript decodeURIComponent() Function
問題14
You are developing an online shopping application that accepts credit cards for payment.
If the credit card number is invalid, the application must:
Generate an error
Assign "200" to the error number
Assign "Invalid" to the error description
You need to write the code that meets the requirements.
How should you write the code? (To answer, select the appropriate option from the drop-down list in the answer area.)


If the credit card number is invalid, the application must:
Generate an error
Assign "200" to the error number
Assign "Invalid" to the error description
You need to write the code that meets the requirements.
How should you write the code? (To answer, select the appropriate option from the drop-down list in the answer area.)


正確答案:

Explanation

Example: throw new Error(200, "x equals zero");
Reference: throw Statement (JavaScript)
問題15
You have the following HTML markup:

You need to create a JavaScript to add an additional option named Air to the shippingType element.
You write the following code.

How should you complete the code? To answer, drag the appropriate lines of code to the correct targets in the answer area. Each line may be used once, more than once, or not at all. You may drag the split bar between panes or scroll to view content.


You need to create a JavaScript to add an additional option named Air to the shippingType element.
You write the following code.

How should you complete the code? To answer, drag the appropriate lines of code to the correct targets in the answer area. Each line may be used once, more than once, or not at all. You may drag the split bar between panes or scroll to view content.

正確答案:

Explanation
Target 1:
Var newOption = document.createElement ("option") ;
Target 2:
Option.appendChild (newOption.text) ;

