You are developing a web application that uses web workers to process images extracted from an
HTML5 CANVAS object on a web page.
You need to pass messages between the web workers and the web page.
Which three types of objects should you use? (Each correct answer presents a complete solution.
Choose three.)
A.
JSON
B.
Window
C.
Parent
D.
String
E.
JavaScript
F.
DOM
can someone provide an explantation?
I can’t quite picture all the details, but the way I managed to guess all the right answers was like this:
String:
Web workers only accept “string” data (you can only send it data as a string (and not e.g. binary data)).
JavaScript:
A canvas image is created using JavaScript (unlike SVG, canvas requires JavaScript for anything to show up).
JSON:
To send the canvas image information to the web worker, the JavaScript that creates the image would be presented as ‘JavaScript Object Notation’ (JSON) format, which can be easily converted to a string (with JSON.stringify).
Looking at it that way, I ticked all the boxes…
Here are several of the web-sites we advise for our visitors.
So where are those sites??
ADE