070-480試験無料問題集「Microsoft Programming in HTML5 with JavaScript and CSS3 認定」
You review a webpage that contains the following markup:

How does the page render? For each statement in the table, select Yes if the behavior is described. Select No if it is not. Make only one selection in each column.


How does the page render? For each statement in the table, select Yes if the behavior is described. Select No if it is not. Make only one selection in each column.

正解:

Explanation

You are validating user input by using JavaScript and regular expressions.
A group of predefined regular expressions will validate two input fields:
* An email address in a function named validateEmail (for example, [email protected])
* A nine-digit number that allows optional hyphens after the second and fifth character in a function named validateSSN(for example, 555555555 or 555-55-5555) You need to use the correct expression to validate the input.
Which expression should you insert into each function? (To answer, drag the appropriate regular expression statement to the correct location. Each regular expression statement 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.)

A group of predefined regular expressions will validate two input fields:
* An email address in a function named validateEmail (for example, [email protected])
* A nine-digit number that allows optional hyphens after the second and fifth character in a function named validateSSN(for example, 555555555 or 555-55-5555) You need to use the correct expression to validate the input.
Which expression should you insert into each function? (To answer, drag the appropriate regular expression statement to the correct location. Each regular expression statement 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

You have the following markup:

You need to complete the styles to meet the following requirements:
How should you complete the styles? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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.


You need to complete the styles to meet the following requirements:
How should you complete the styles? To answer, drag the appropriate code elements to the correct targets in the answer area. Each code element 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
Target 1: Flex
Target 2: 1
Target 3: Flex
Target 4: 2
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
You develop an HTML5 webpage that contains the following markup and code:

You have the following requirements:
* Display a message if users select the first OPTION element, and then submit the form.
* Do not display an alert message if users select any other OPTION element, and then submit the form.
You need to implement the madeSelection() function.
How should you complete the relevant code? (To answer, select the appropriate code segment from each drop-down list in the answer area.)



You have the following requirements:
* Display a message if users select the first OPTION element, and then submit the form.
* Do not display an alert message if users select any other OPTION element, and then submit the form.
You need to implement the madeSelection() function.
How should you complete the relevant code? (To answer, select the appropriate code segment from each drop-down list in the answer area.)


正解:

Explanation

* The <select> element is used to create a drop-down list.
The <option> tags inside the <select> element define the available options in the list.
* option.value
text
Specifies the value to be sent to a server
Reference: HTML <option> Tag
You develop an HTML5 application that interacts with a REST service. The REST service accepts JSON data.
A JavaScript object named form Data contains data that is sent to the REST service.
You need to convert the JavaScript object named formData into JSON.
Which code segment should you use?
A JavaScript object named form Data contains data that is sent to the REST service.
You need to convert the JavaScript object named formData into JSON.
Which code segment should you use?
正解:A
解答を投票する
You are creating a web worker for an HTML5 application.
The following tasks must be performed from within the web worker:
* Register an event listener for the web worker
* Start and stop the web worker
You need to define a function that performs the required tasks.
Which code segment should you use? (To answer, select the appropriate option from the drop-down list in the answer area.)


The following tasks must be performed from within the web worker:
* Register an event listener for the web worker
* Start and stop the web worker
You need to define a function that performs the required tasks.
Which code segment should you use? (To answer, select the appropriate option from the drop-down list in the answer area.)


正解:

Explanation

* addEventListener
The addEventListener() method attaches an event handler to the specified element.
In context of a worker, both self and this refer to the global scope. The worker can either add an event listener for the message event, or it can define the onmessage handler to listen for any messages sent by the parent thread.
* postmessage
Pass a message to the worker.
* close()
Terminating Workers
Workers are resource-intensive; they are OS-level threads. Therefore, you do no want to create a large number of worker threads, and you should terminate the web worker after it completes its work. Workers can terminate themselves, like this:
self.close();
Reference: HTML DOM addEventListener() Method; The Basics of Web Workers
You are developing an application that uses a third-party JavaScript library named doWork().
The library occasionally throws an "object is null or undefined" error with an error code of
-2146823281.
The application must:
* Extract and handle the exceptions thrown by doWork()
* Continue normal program execution if other exceptions occur
You need to implement the requirements.
Which code segment should you use?

The library occasionally throws an "object is null or undefined" error with an error code of
-2146823281.
The application must:
* Extract and handle the exceptions thrown by doWork()
* Continue normal program execution if other exceptions occur
You need to implement the requirements.
Which code segment should you use?

正解:B
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)
You develop a webpage by using HTML5.
The user interface of the webpage must show a gray-lined box that contains the label Enter your information:.
Inside the box are two labels and two input boxes. The first input box must be labeled Name:. The second input box must be labeled Email:. Below the box is a Submit button.
The user interface must look like the following;

You need to create the user interface.
Which markup should you use?

The user interface of the webpage must show a gray-lined box that contains the label Enter your information:.
Inside the box are two labels and two input boxes. The first input box must be labeled Name:. The second input box must be labeled Email:. Below the box is a Submit button.
The user interface must look like the following;

You need to create the user interface.
Which markup should you use?

正解:D
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)
You are developing an application by using JavaScript.
You must write a function that returns the sum of the variables named v1, v2, v3, v4.
You need to complete the sum function.
How should you complete the relevant code? (To answer, drag the appropriate code segment or segments to the correct location or locations in the answer area. Use only code segments that apply.)

You must write a function that returns the sum of the variables named v1, v2, v3, v4.
You need to complete the sum function.
How should you complete the relevant code? (To answer, drag the appropriate code segment or segments to the correct location or locations in the answer area. Use only code segments that apply.)

正解:

Explanation

* What is the difference between call and apply?
apply lets you invoke the function with arguments as an array; call requires the parameters be listed explicitly.
Pseudo syntax:
theFunction.apply(valueForThis, arrayOfArgs)
theFunction.call(valueForThis, arg1, arg2, ...)
Reference: What is the difference between call and apply?