{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

图灵程序设计丛书:HTML5数据推送应用开发

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

图灵程序设计丛书:HTML5数据推送应用开发

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

如今,数据推送技术在网站和Web应用中得到了广泛应用,比如在拍卖网络应用中推送新出价,在售书网站推送新评论,在在线游戏中推送新高分,推送用户感兴趣的新微博,等等。
本书是一本简明的数据推送技术指南,作者通过构建一个真实的例子,手把手地向读者展示如何利用HTML5 SSE(Server-Sent Events,服务端推送事件)这项非凡的技术,无需轮询或者用户交互,就可以将新数据从服务器端推送到客户端。
此外,本书还比较了数据推送和WebSocket的区别,阐释了如何使用不同的向后兼容解决方案,将应用的桌面和移动浏览器支持率从60%增加到99%。只要熟悉HTML、HTTP和基本的JavaScript,就可以开始你的学习之旅。
Content Description

《图灵程序设计丛书:HTML5数据推送应用开发》详细介绍了SSE(Server-Sent Event,服务端推送事件)。SSE是一种允许服务端向客户端推送新数据的HTML5技术。利用这种技术,网页可以迅速加载,并且能及时获得用户感兴趣的全新数据。相比数据拉取,SSE是更优的解决方案,能极大地降低延迟。《图灵程序设计丛书:HTML5数据推送应用开发》通过丰富的示例详细叙述了SSE的优势、它在的日常生活中的应用、目前的浏览器支持情况以及兼容解决方案等内容。
只要你略微了解一点HTML、HTTP和JavaScript,就可以顺利阅读《图灵程序设计丛书:HTML5数据推送应用开发》。
Author Description

Darren Cook,精通多种计算机语言,包括JavaScript、PHP以及C++,拥有20多年软件开发及项目管理经验,涉及金融交易系统、数据可视化工具、大公司的网站乃至电子游戏。他开发过类似Twitter的HTTP流数据网络服务系统,还为许多应用写过底层的套接字服务器端/客户端协议,构建过使用SSE和WebSockets的应用。

刘帅,百度前端高级研发工程师,毕业于哈尔滨工程大学,获得计算机科学与技术专业学士学位。毕业以来一直从事前端开发工作,先后就职于新浪、阿里巴巴、腾讯、百度,参与开发了基于HTML5技术的腾讯浏览器、QQforWindows8、百度打车WebApp版,现参与开发百度地图。
Comments

“数据推送是Web应用所涉及的一项关键技术,本书会告诉你如何利用全新的HTML5技术予以实现,并展示各种向后兼容方案的选择。不过在使用之前你仍然要回答这个问题:你的Web应用到底是否需要使用数据推送?当然,在你阅读完本书之后,答案便了然于心。”
——百度研发工程师 贾铮

“如果你希望一有全新消息发布,你的Web客户端就立即更新,那么就来学习本书吧。本书展示了利用HTML5和数据推送技术,使你的用户在几乎所有现代平台上及时收到全新消息。”
——Peter MacIntyre,Paladin Business Solutions总裁

“HTML5 SSE是响应式动态交互Web前端的未来趋势。本书阐述了如何在客户端和服务器端实现SSE。此外,你还将学到PHP的相关知识,以及如何设计高性能、安全的Web应用。”
——Stuart Woodward,Hanamaru K.K.高级软件架构师
Catalogue

前言
第1章 SSE及其他
1.1 HTML5
1.2 数据推送
1.3 数据推送的其他名称
1.4 可能会用到SSE的应用
1.5 和WebSocket的对比
1.6 什么时候数据推送是错误的选择
1.7 决策、决策还是决策
1.8 带我看代码吧

第2章 玩转SSE
2.1 最简单的示例:前端
2.2 使用jQuery吗
2.3 最简示例:后端
2.4 基于Node.js的后端
2.4.1 基于Node.js的最简Web服务器
2.4.2 用Node.js做推送
2.4.3 在浏览器中运行
2.5 华丽退场

第3章 迷人的真实数据推送应用
3.1 问题领域
3.2 后端
3.3 前端
3.4 可复现的真实随机数据
3.5 精磨时间戳
3.6 控制好随机性
3.7 为时间的真正流逝留出余地
3.8 本章内容盘点

第4章 别安于现状
4.1 数据的更多构成
4.2 重构PHP
4.3 重构JavaScript
4.4 历史数据存储
4.5 永久存储
4.6 现在我们是历史学家

第5章 走出象牙塔,打造产品级品质
5.1 错误处理
5.2 错误的JSON
5.3 长连接
5.3.1 服务器端
5.3.2 客户端
5.3.3 SSE重试
5.4 添加定期的关闭/重连
5.5 发送Last-Event-ID
5.6 多路数据ID
5.7 使用Last-Event-ID
5.8 在重连时发送ID
5.9 不要全局化,考虑本地化
5.10 阻止缓存
5.11 阻止死亡
5.12 精简的简单办法
5.13 本章回顾

第6章 向后兼容:其他数据推送策略
6.1 浏览器战争
6.2 什么是轮询
6.3 怎样做长轮询
6.4 给我看些代码
6.5 优化长轮询
6.6 如果JavaScript被禁用怎么办
6.7 将长轮询移植到我们的外汇交易应用
6.7.1 连接
6.7.2 长轮询和长连接
6.7.3 长轮询和连接错误
6.7.4 服务器端
6.7.5 处理数据
6.7.6 接起来
6.7.7 IE8及更早版本
6.7.8 IE7及其更早版本
6.8 蜿蜒曲折的轮询

第7章 向后兼容:另辟蹊径
7.1 共性
7.2 XHR
7.3 iframe
7.4 将XHR/iframe移植到外汇交易应用
7.4.1 后端的XHR
7.4.2 前端的XHR
7.4.3 前端的iframe
7.4.4 接通XHR
7.4.5 接通iframe
7.5 感谢内存
7.6 把襁褓中的外汇交易应用放到床上

第8章 关于SSE的其他标准
8.1 请求头
8.2 事件
8.3 多行数据
8.4 消息中的空白
8.5 又见请求头
8.6 这就是全部内容吗

第9章 认证授权:谁在敲门
9.1 Cookie
9.2 认证授权(使用Apache服务器)
9.3 带有SSE的HTTP POST
9.4 多重鉴权选择
9.5 SSL和CORS(连接到其他服务器)
9.6 Allow-Origin
9.7 完善访问控制
9.8 HEAD和OPTIONS
9.9 Chrome和Safari以及CORS
9.10 构造函数与证书
9.11 withCredentials
9.12 CORS和向后兼容方案
9.12.1 CORS和IE9及其更早版本
9.12.2 IE8/IE9:总是使用长轮询
9.12.3 动态处理IE9及其更早版本
9.13 汇总
9.14 未来会有更多一样

附录A SSE标准
A.1 W3C候选推荐标准2012.12.11
A.1.1 摘要
A.1.2 本文档的状态
A.1.3 目录
A.1.4 引言
A.1.5 一致性要求
A.1.6 术语
A.1.7 EventSource接口
A.1.8 处理模型
A.1.9 解析事件流
A.1.10 解释事件流
A.1.11 注意事项
A.1.12 连接推送和其他特性
A.1.13 垃圾回收
A.1.14 IANA须知
A.1.15 参考文献
A.1.16 致谢

附录B 重构:JavaScript全局变量、对象和闭包
B.1 示例
B.2 问题是……
B.3 JavaScript对象和构造函数
B.4 用对象的代码
B.5 JavaScript闭包

附录C PHP
C.1 PHP中的类
C.2 随机函数
C.3 超全局变量
C.4 数据处理
C.5 密码
C.6 休眠
Introduction

人们对现代网络要求甚高:不仅要求页面美观,加载迅速,还必须有最新、有趣而且有价值的好内容。《图灵程序设计丛书:HTML5数据推送应用开发》探讨的是一项有助于满足后两个要求的技术:确保你的网站或网络应用用户获取最新的内容,并且毫不妥协地最大限度降低延迟。
《图灵程序设计丛书:HTML5数据推送应用开发》还关注现实生活中有实用价值的应用。第2 章以一个非常好玩的范例为基础,第6 章和第7 章用的是入门级的例子,其他章节则都是围绕现实生活中无处不在且又无法回避的完整应用。
读者对象
在现实生活中,你必须是一个健壮而谦恭、热情而客观的人,你还必须尊老爱幼并且极度热爱互联网。不过,本书没有现实世界那么苛刻,但你需要了解HTML(超文本标记语言)和HTTP(超文本传送协议),并且也知道HTML、CSS(层叠样式表)和JavaScript之间的区别。你至少应该能够阅读并理解基本的JavaScript,以便能理解客户端的代码。(当用到更为复杂的JavaScript 时,我们会在附注或附录中加以解释。)
本书尽可能保持服务端语言中立,所用到的代码大部分是简单的PHP 代码,因为对这类应用来说,PHP 言简意赅。只要你了解任何类C 语言,应该就不难读懂。如果有不懂的地方,请参阅附录C,那里会介绍一些PHP 相关知识。第2 章也会介绍使用Node.js 的例子。在后面的章节中,如果示例代码是PHP 专用的,我也会介绍如何用其他语言来实现。
最后,你需要有一台装有网络服务器(如Apache)的开发机,以便跟着文中的范例学。许多Linux 系统已经安装了Apache,如果没有,安装起来也不难。举个例子,在Ubuntu 系统中,在命令行终端输入sudo apt-get install lamp-server 1 就能一步安装Apache、PHP和MySQL。在Windows 系统中,有一个类似的集成包——XAMPP,它会给你提供所需要的一切。它还有Mac 版。
注1: 如果这个命令不生效,试一下sudo apt-get install lamp-server。——译者注
本书结构:
SSE 的核心要素并不复杂,第2 章仅用了几页的篇幅就介绍了一个完整可运行的范例(包括前端和后端)。在那之前,第1 章会介绍HTML5 的一些背景知识、数据推送、可能会用到SSE 的应用,以及用作替代方案的技术。
从第3 章到第7 章,我们创建了一个完整的应用,尽可能使它贴近现实,同时又不会让你为那些不重要的细节而烦恼。这个应用所涉及的领域是金融数据。第3 章介绍这个应用的核心;第4 章对它做了一些重构和扩展;第5 章处理了数据推送应用中会出现的一些棘手的细节,比如复杂的数据、数据源无响应、套接字终止等;第6 章介绍了一种方案(长轮询),使我们的应用能够兼容那些尚未支持SSE 的台式机浏览器和手机浏览器;第7 章展示了两种更优但并不是所有浏览器都支持的方案。第3 章还用了一些篇幅,介绍如何开发我们的样本应用程序可以推送的真实且可重复使用的数据。虽然这与SSE 不直接相关,但这非常好地演示了数据推送应用中的易测性设计。
第8 章涵盖了SSE 协议的一些要素,我们没有将它们用于在其他章节创建的实用应用程序中。当然,我们介绍了没有使用它们的原因。这就引出了第9 章来介绍之前章节提到过但未详细阐述的安全方面的内容(cookie、权限控制、跨域)。

Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book