Microsoft Programming in HTML5 with JavaScript and CSS3 - 70-480 FREE EXAM DUMPS QUESTIONS & ANSWERS
You are developing a customer web form that includes the following HTML.
<label id="txtValue"X/label>
Information from the web form is submitted to a web service. The web service returns the following JSON object.
{
"Confirmation": "1234",
"FirstName": "John"
}
You need to display the Confirmation number from the JSON response in the txtValue label field.
Which JavaScript code segment should you use?
<label id="txtValue"X/label>
Information from the web form is submitted to a web service. The web service returns the following JSON object.
{
"Confirmation": "1234",
"FirstName": "John"
}
You need to display the Confirmation number from the JSON response in the txtValue label field.
Which JavaScript code segment should you use?
Correct Answer: B
Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
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 line of code should you use? (To answer, drag the appropriate line or lines of code to the correct location or locations. Each line of code 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 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 line of code should you use? (To answer, drag the appropriate line or lines of code to the correct location or locations. Each line of code 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.)

Correct Answer:

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 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?
You need to choose an approach for loading the data.
What should you do?
Correct Answer: C
Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).
You are creating a function by using JavaScript. The function accepts an object as the parameter and returns a string that identifies the data type of the object.
You have the following requirements:
* The function must return "Number" if the object is a number
* The function must return "String" if the object is a string
* The function must return "Unknown" if the object is neither a number nor a string You need to implement the function to meet the requirements.
How should you build the code segment? (To answer, drag the appropriate word to the correct location in the code segment. Each word 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 have the following requirements:
* The function must return "Number" if the object is a number
* The function must return "String" if the object is a string
* The function must return "Unknown" if the object is neither a number nor a string You need to implement the function to meet the requirements.
How should you build the code segment? (To answer, drag the appropriate word to the correct location in the code segment. Each word 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.)

Correct Answer:

Explanation

* Use the switch statement to select one of many blocks of code to be executed.
Syntax
switch(expression) {
case n:
code block
break;
case n:
code block
break;
default:
default code block
}
This is how it works:
The switch expression is evaluated once.
The value of the expression is compared with the values of each case.
If there is a match, the associated block of code is executed.
* Object.prototype.constructor
Returns a reference to the Object function that created the instance's prototype. Note that the value of this property is a reference to the function itself, not a string containing the function's name. The value is only read-only for primitive values such as 1, true and "test".
* Description
All objects inherit a constructor property from their prototype:
var o = {};
o.constructor === Object; // true
var a = [];
a.constructor === Array; // true
var n = new Number(3);
n.constructor === Number; // true
* The constructor property is created together with the function as a single property of func.prototype.
Reference: JavaScript Switch Statement;Object.prototype.constructor
You are developing a web application that retrieves data from a web service. The data being retrieved is a custom binary datatype named bint. The data can also be represented in XML.
Two existing methods named parseXml() and parseBint() are defined on the page.
The application must:
* Retrieve and parse data from the web service by using binary format if possible
* Retrieve and parse the data from the web service by using XML when binary format is not possible You need to develop the application to meet the requirements.
What should you do? (To answer, drag the appropriate code segment to the correct location. 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.)

Two existing methods named parseXml() and parseBint() are defined on the page.
The application must:
* Retrieve and parse data from the web service by using binary format if possible
* Retrieve and parse the data from the web service by using XML when binary format is not possible You need to develop the application to meet the requirements.
What should you do? (To answer, drag the appropriate code segment to the correct location. 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.)

Correct Answer:

Explanation

* accepts : 'application/bint, text/xml'
accepts:'application/bin,text/xml' to accept only XML and binary content in HTML responses.
* Use the following condition to check if the html response content is
binary: If(request.getResponseHeader("Content-Type")=="application/bint"
* var request = $.ajax({
uri:'/',
accepts: 'application/bint, text/xml',
datafilter: function(data,type){
if(request.getResponseHeader("Content-Type")=="application/bint")
return parseBint(data);
else
return parseXml();
},
success: function (data) {
start(data);
}
});
You have a stylesheet for an existing website.
The website contains the following HTML markup.
You need to apply a custom font named MyFont1 to all of the navigation elements.
You write the following markup in the stylesheet.
How should you complete the markup? To answer, drag the appropriate code elements to the correct targets.
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.
NOTE: Each correct selection is worth one point.

The website contains the following HTML markup.
You need to apply a custom font named MyFont1 to all of the navigation elements.
You write the following markup in the stylesheet.
How should you complete the markup? To answer, drag the appropriate code elements to the correct targets.
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.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation

References:
https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp
https://www.html5rocks.com/en/tutorials/webfonts/quick/
You need to create a function that meets the following requirements.
* Extend a Array object by using function
* Removes a specified item from the array
You write the following code.

How should you complete the code? To answer, drag the appropriate code elements to the targets. Each code eolemen may be used once, more than once. Ore not at all. You may need to drag the split bar between paries or scroll to view content.

* Extend a Array object by using function
* Removes a specified item from the array
You write the following code.

How should you complete the code? To answer, drag the appropriate code elements to the targets. Each code eolemen may be used once, more than once. Ore not at all. You may need to drag the split bar between paries or scroll to view content.

Correct Answer:

Explanation

You develop an HTML5 chat application.
You need to provide real-time updates to the messages that users post in the chat application.
What should you do?
You need to provide real-time updates to the messages that users post in the chat application.
What should you do?
Correct Answer: B
Vote an answer
Explanation: Only visible for FreeCram members. You can sign-up / login (it's free).