exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 1 question 26 discussion

Actual exam question from Microsoft's 70-480
Question #: 26
Topic #: 1
[All 70-480 Questions]

You are developing a web application that consumes services from a third-party application. A web worker processes the third-party application requests in the background. A page in the application instantiates the web worker process.
You need to establish two-way communications between the web worker process and the page.
Which two actions will achieve this goal? (Each correct answer presents a complete solution. Choose two.)

  • A. From the web worker, use the onopen event handler of the main page to capture events.
  • B. From the main page, use the onmessage event handler of the web worker to capture events.
  • C. From the web worker, use the onmessage event handler of the main page to capture events.
  • D. From the main page, use the onopen event handler of the web worker to capture events.
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️
* When postMessage() is called from the main page, our worker handles that message by defining an onmessage handler for the message event.
* Server-Sent Events - One Way Messaging
A server-sent event is when a web page automatically gets updates from a server.
Receive Server-Sent Event Notifications
The EventSource object is used to receive server-sent event notifications:

Example -
var source = new EventSource("demo_sse.php");
source.onmessage = function(event) {
document.getElementById("result").innerHTML += event.data + "<br>";
};
Reference:
http://www.w3schools.com/html/html5_serversentevents.asp
http://www.html5rocks.com/en/tutorials/workers/basics/

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...