Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook
Lesson 1: Asynchronous operations using jQuery and WinJS CHAPTER 9 399 thirdPromise.done(function () { var fourthPromise = timeo ...
400 CHAPTER 9 Asynchronous operations Quick check ■■You want to chain several asynchronous calls together. Which promise method ...
Lesson 1: Asynchronous operations using jQuery and WinJS CHAPTER 9 401 The following example is a rewrite of the previous exampl ...
402 CHAPTER 9 Asynchronous operations }); return fourthPromise; } In this example, the includeThird variable is passed into the ...
Lesson 1: Asynchronous operations using jQuery and WinJS CHAPTER 9 403 ■■The deferred object’s resolve and resolvewith methods i ...
404 CHAPTER 9 Asynchronous operations Lesson 2: Working with web workers Another way to perform asynchronous operations is to us ...
Lesson 2: Working with web workers CHAPTER 9 405 This HTML page has a reference to jQuery and a default.js file. The default.js ...
406 CHAPTER 9 Asynchronous operations ■■The postMessage method accepts a serializable object. ■■The web worker does not have acc ...
Practice exercises CHAPTER 9 407 Start Visual Studio. Click File and choose New Project. Navigate to Installed | Templates | Vi ...
408 CHAPTER 9 Asynchronous operations Add a element inside the messageBox element and set its id attribute to messageContent. ...
Practice exercises CHAPTER 9 409 position: absolute; background-color: black; z-index:100; top: 0px; left: 0px; width: 100%; hei ...
410 CHAPTER 9 Asynchronous operations To provide an animated fade-in of the cover element, create a displayCoverAsync func- tio ...
Practice exercises CHAPTER 9 411 return hours + ':' + (minutes < 10? '0' + minutes : minutes); } Add code that executes when ...
412 CHAPTER 9 Asynchronous operations Add a hideCoverAsync function. In the function, add code to fade out the cover ele- ment ...
Answers CHAPTER 9 413 Answers This section contains the answers to the lesson review questions in this chapter. Lesson 1 Correc ...
414 CHAPTER 9 Asynchronous operations Lesson 2 Correct answer: D A. Incorrect: There is no updateDom() method. B. Incorrect: Th ...
415 Chapter 10 WebSocket communications CHAPTER 10 WebSocket communications T his book has covered AJAX and web services, which ...
416 CHAPTER 10 WebSocket communications that the client is waiting for data, and the server has an open connection. When data is ...
Lesson 1: Communicating by using WebSocket CHAPTER 10 417 ■■binaryType A property that indicates the binary data format the onme ...
418 CHAPTER 10 WebSocket communications var webSocket; $(document).ready(function () { if (checkSupported()) { connect(); $('#bt ...
«
17
18
19
20
21
22
23
24
25
26
»
Free download pdf