Skip to Content
JAVASCRIPT網頁應用程式設計
book

JAVASCRIPT網頁應用程式設計

by Alex MacCaw
January 2013
Intermediate to advanced
332 pages
5h 23m
Chinese
GoTop Information, Inc.
Content preview from JAVASCRIPT網頁應用程式設計
第八章
即時網頁(Real-time web
即時網頁為什麼會變得這麼重要?因為既然我們所處的真實世界,可讓我們隨時隨地、
即時的取得各式各樣的新資訊,人們自然也會期許網頁應用程式能比照辦理。使用者渴
求著能透過網頁應用程式滿足即時對談、即時獲取新知,以及即時搜尋資訊等需求。時
至今日,人們對於網際網路傳遞資訊的速度要求,早已和以往大不相同(晚幾分鐘才看
到插播新聞快報的情形,已經不能被接受了)。像 GoogleFacebook,以及 Twitter 之類
的大型公司,皆已迅速的趕上這股潮流,為他們所提供的服務加上了即時互動的功能。
這是目前最火紅的潮流,而且相信這股熱潮還會持續延燒下去。
即時網頁技術的演進
過去,網頁是以 HTTP 的請求 / 回應模型建構:用戶端發出檢視網頁的請求,伺服器端
便針對該請求提供回應,除非用戶端再次發出檢視另一張網頁的請求,否則什麼事都不
會發生。隨後問世的 Ajax,讓網頁運作感覺更動態一些(因為 Ajax 會在背景發送請求
給伺服器端)。不過,如果伺服器端在提供回應之後,還有更多更新的資訊想提供給用
戶端,仍舊沒辦法在用戶端已經載入完網頁之後,再通知用戶端;也就是說,伺服器端
無法主動將最新資訊推送至用戶端。
有鑑於此,眾人紛紛集思廣益,構思出各種解決方案。一種最簡單的做法是輪詢
polling),它的概念很簡單:不斷地詢問伺服器,確認是否有更新的資訊。這麼做的
確能讓使用者感受到即時的資訊更新。但在實務上,這種做法會降低效能,因為它迫使
伺服器每秒都得處理大量的連線,每組連線都會佔用一定程度的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

Ethan Brown, 武舎 広幸, 武舎 るみ
PHP编程:第4版

PHP编程:第4版

Kevin Tatroe, Peter MacIntyre
Strange Code

Strange Code

Ronald T. Kneusel
Perfecting Your Thinking Skills

Perfecting Your Thinking Skills

MIT Sloan Management Review

Publisher Resources

ISBN: 9789862766811