1.

What will happen if you specify an absolute URL in the Worker constructor?(a) Resolves itself(b) Must have the same origin(c) Must not have the same origin(d) Specify the addressThis question was posed to me during an interview.My doubt stems from Web Workers in portion Caching, Debugging and Animation of JavaScript

Answer»

Right ANSWER is (b) Must have the same origin

The best explanation: If you specify an ABSOLUTE URL, it must have the same origin (same protocol, host, and port) as that containing document. In Firefox, if you WANT to use workers in extensions and would like to have access to js-ctypes, you should use the ChromeWorker OBJECT instead.



Discussion

No Comment Found

Related InterviewSolutions