070-480試験無料問題集「Microsoft Programming in HTML5 with JavaScript and CSS3 認定」

You are developing an application in HTML5.
You have the following code.

You need to add an additional property to the function definition.
Which line of code should you use?

解説: (GoShiken メンバーにのみ表示されます)
You are developing a page by using HTML. You have the following HTML markup within the page.

You need to dynamically add the following HTML markup to the list of links.
<a href="help.html">Help</a>
The new link must appear last on the list.
How should you complete the JavaScript code? To answer, select the appropriate options in the answer area.
正解:

Explanation

var para = document.createElement("a");
var attr = document.createAttribute("href");
attr.value = "help.html";
para.setAttributeNode(attr);
var node = document.createTextNode("Help");
para.appendChild(node);
var element = document.getElementById("navlist");
element.appendChild(para);
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.)

正解:

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 are creating an application by using HTML5 and CSS3. The styles for the pages are derived from five style sheets.
You need to order the style sheets by greatest CSS rule weight to lowest CSS rule weight.
In which order will the five style sheets be applied by the browser? To answer, move the style sheet types from the list of style sheet types to the answer area and arrange them in the order in which the browser will apply them. The first style sheet that the browser will apply must appear at the top of the list in the answer area.
正解:

Explanation

References:
https://www.w3.org/TR/css-cascade-3/#importance
You develop an HTML application that calls a web service to retrieve JSON data. The web service contains one method named GetFullName that returns an Object named data. The data object contains two properties named GivenName and Surname.
You need to load data from the web service to the webpage.
How should you complete the relevant code? (To answer, drag the appropriate code segment or code segments to the correct location or locations in the answer area. Use only code segments that apply.)
正解:

Explanation

You can access object properties in two ways:
objectName.propertyName
or
objectName[propertyName]
Reference: JavaScript Objects
You have the following markup.

You need to identify in which color each value will be displayed.
Which color should you identify? To answer, select that appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
正解:

Explanation

Boat: Red
Car: Blue
Plane: Violet
You create an HTML5 webpage. You have the following HTML markup:

You also have the following JavaScript code segment:
var jsonFruit = { "apples" : "12", "bananas" : "8", "watermelon" : "3" } You need to add additional rows to the fruitTable element by processing the jsonFruit values in the order listed.
Which three actions should you perform in sequence? (Develop the solution by selecting the required code segments and arranging them in the correct order.)
正解:

Explanation
Box 1:

Box 2:

Box 3:

* The appendTo() method inserts HTML elements at the end of the selected elements.
* example to loop over a JavaScript array object.
var json = [
{"id":"1","tagName":"apple"},
{"id":"2","tagName":"orange"},
{"id":"3","tagName":"banana"},
{"id":"4","tagName":"watermelon"},
{"id":"5","tagName":"pineapple"}
];
$.each(json, function(idx, obj) {
alert(obj.tagName);
});
Reference: jQuery appendTo() Method;JQuery Loop Over JSON String - $.Each Example
You develop an HTML application that is located at www.adventure-works.com. The application must load JSON data from www.fabrikam.com.
You need to choose an approach for loading the data.
What should you do?

解説: (GoShiken メンバーにのみ表示されます)
You have the following code:

You need to convert objStr into an array.
Which line of code should you use?

解説: (GoShiken メンバーにのみ表示されます)
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.)
正解:

Explanation
You have the following code:

You need to identify the correct value of each variable.
What should you identify? To answer, drag the appropriate values to the correct variables in the answer area.
Each value 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

References:
http://www.w3schools.com/jsref/jsref_parseint.asp
You troubleshoot a webpage that contains the following HTML markup: (Line numbers are included for reference only.)

The webpage also contains the following JavaScript function named someEvent() that is declared in the HEAD section of the HTML:
Function someEvent() {
Alert('someEvent fired!');
}
The JavaScript function named someEvent() must run only when the user clicks the DIV element, not the INPUT elements.
You need to modify the webpage to invoke the JavaScript function named someEvent().
What should you do? (Each correct answer presents a complete solution. Choose two.)

You have the following code.

You discover that the displayGlobalProduct function displays a value of boat.
You need to change the function to display a value of car.
Which line of code can you use to replace the alert?

解説: (GoShiken メンバーにのみ表示されます)
You develop a webpage that allows a user to download a JPEG image and convert it to a PNG file.
You need to implement the code to download the contents of the JPEG image with no additional decoding.
Which JavaScript function should you use?

解説: (GoShiken メンバーにのみ表示されます)