12. Communication and Threading

The HTML5 APIs cover a wide range of improvements and areas, but two of the newest ones include the WebSocket and Web Workers APIs. These two sets fill some key gaps in website and web application development. Before these APIs, opening a bidirectional communication channel with servers was difficult. In addition, performing heavy processing in the page blocked the user interface from user interaction. The WebSocket API provides bidirectional communication between client JavaScript and a server over a socket connection, while the Web Workers API opens up basic threading options to client JavaScript. In this chapter, you will learn how to implement these APIs in some simple but effective recipes by which you can ...

Get HTML5 Developer’s Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.