TAILIEUCHUNG - Phát triển Javascript - part 33

Tham khảo tài liệu 'phát triển javascript - part 33', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Streaming Data with Ajax and Comet In Chapter 12 Abstracting Browser Differences Ajax we saw how the XMLHttpRequest object enables web pages to take the role of interactive applications that can both update data on the back-end server by issuing POST requests as well as incrementally update the page without reloading it using GET requests. In this chapter we will take a look at technologies used to implement live data streaming between the server and client. This concept was first enabled by Netscape s Server Push in 1995 and is possible to implement in a variety of ways in today s browsers under umbrella terms such as Comet Reverse Ajax and Ajax Push. We will look into two implementations in this chapter regular polling and so-called long polling. This chapter will add some features to the interface developed in the previous chapter add a new interface and finally integrate with developed in Chapter 11 The Observer Pattern enabling us to create a streaming data client that allows JavaScript objects to observe server-side events. The goal of this exercise is twofold learning more about models for clientserver interaction and of course test-driven development. Important TDD lessons in this chapter includes delving deeper into testing asynchronous interfaces and testing timers. We will continue our discussion of stubbing and get a glimpse of the workflow and choices presented to us as we develop more than a single interface. Download from 293 294 Streaming Data with Ajax and Comet Polling for Data Although one-off requests to the server can enable highly dynamic and interesting applications it doesn t open up for real live applications. Applications such as Facebook s and GTalk s in-browser chats are examples of applications that cannot make sense without a constant data stream. Other features such as stock tickers auctions and Twitter s web interface become significantly more useful with a live data .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.