Instant HTML5 Local Storage How-to
暫譯: 即時 HTML5 本地儲存操作指南

Alex Libby

  • 出版商: Packt Publishing
  • 出版日期: 2013-03-24
  • 售價: $1,010
  • 貴賓價: 9.5$960
  • 語言: 英文
  • 頁數: 80
  • 裝訂: Paperback
  • ISBN: 1849699313
  • ISBN-13: 9781849699310
  • 相關分類: HTML
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

相關主題

商品描述

Over 15 recipes to take advantage of the HTML5 Local Storage standard.

Overview

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results.
  • Learn the basics of how to use the LocalStorage standard, and view the results in your browser
  • Learn how to detect when you can use LocalStorage, or when to fall back to using cookies, as well as how to convert an existing site to use LocalStorage
  • Using LocalStorage to store images, arrays, and objects for use in your site

In Detail

The use of cookies to store information in a browser has been around for over a decade; its simplicity has led to its use in a variety of applications, such as online shopping baskets, but which has also lead to some inherent drawbacks in terms of security and use. HTML5 LocalStorage brings much needed additional functionality to your browser, allowing you to store more useful information that you can later reference in your websites.

"Instant HTML5 Local Storage How-to" is a practical, hands-on guide that provides you with a number of clear step-by-step exercises, which will help you take advantage of the power of the LocalStorage standard, and give you a good grounding in incorporating it into current or future website projects.

This book looks at how you can incorporate the HTML5 LocalStorage standard into your websites, using the power of modern browsers to store useful information that can be referenced at any time without recourse to the server.

You will also learn how to test for browser capability, and when the browser platform being used requires that you fall back to using cookies. We will also take a look at how you can store more relevant content, such as images or content from arrays, even though the normal standard requires content to be stored in string format. You will also learn how you can make content available offline using application caching, as well as how to incorporate LocalStorage into a plugin using jQuery that you can then incorporate into your sites in the future.

We will also look at some real-life examples, where "Instant HTML5 Local Storage How-to" will take you through how you could incorporate LocalStorage into your sites; we’ll take a look at code you can simply add to a site, or use as a development platform for your own future projects.

What you will learn from this book

  • Basic usage of HTML5 Storage, including its limitations and security
  • Viewing localStorage content in my browser
  • Building a basic demo using session and local storage
  • Adding detection to a site to determine when you can use LocalStorage
  • Implementing application caching, with checks to determine online status
  • Using web storage instead of cookies
  • Building a simple plugin using jQuery
  • Adding objects, arrays, images, and TTL support to storage
  • Adjusting local storage space for browsers

Approach

Filled with practical, step-by-step instructions and clear explanations for the most important and useful tasks. Get the job done and learn as you go. Step-by-step recipes to get to grips with the LocalStorage standard.

商品描述(中文翻譯)

超過 15 個食譜,讓您充分利用 HTML5 Local Storage 標準。

概述
- 立即學習新知!一本短小、快速、專注的指南,提供即時結果。
- 學習如何使用 LocalStorage 標準的基本知識,並在瀏覽器中查看結果。
- 學習如何檢測何時可以使用 LocalStorage,或何時需要回退使用 cookies,以及如何將現有網站轉換為使用 LocalStorage。
- 使用 LocalStorage 儲存圖像、陣列和物件,以便在您的網站中使用。

詳細內容
使用 cookies 在瀏覽器中儲存資訊已經有十多年歷史;其簡單性使其在各種應用中得到使用,例如線上購物車,但這也導致了在安全性和使用上的一些固有缺陷。HTML5 LocalStorage 為您的瀏覽器帶來了急需的附加功能,允許您儲存更多有用的資訊,您可以在網站中隨時引用。

《即時 HTML5 Local Storage 使用指南》是一本實用的、動手操作的指南,提供多個清晰的逐步練習,幫助您充分利用 LocalStorage 標準的強大功能,並為您在當前或未來的網站專案中整合它打下良好的基礎。

本書探討如何將 HTML5 LocalStorage 標準整合到您的網站中,利用現代瀏覽器的力量儲存有用的資訊,這些資訊可以隨時引用,而無需依賴伺服器。

您還將學習如何測試瀏覽器的能力,以及當所使用的瀏覽器平台需要您回退使用 cookies 時的情況。我們還將探討如何儲存更相關的內容,例如圖像或來自陣列的內容,即使正常標準要求內容以字串格式儲存。您還將學習如何使用應用快取使內容在離線時可用,以及如何使用 jQuery 將 LocalStorage 整合到插件中,然後將其納入未來的網站中。

我們還將查看一些實際範例,《即時 HTML5 Local Storage 使用指南》將帶您了解如何將 LocalStorage 整合到您的網站中;我們將查看您可以簡單添加到網站的程式碼,或用作您未來專案的開發平台。

您將從本書中學到的內容
- HTML5 Storage 的基本使用,包括其限制和安全性
- 在我的瀏覽器中查看 localStorage 內容
- 使用 session 和 local storage 建立基本示範
- 為網站添加檢測,以確定何時可以使用 LocalStorage
- 實現應用快取,並檢查在線狀態
- 使用網頁儲存代替 cookies
- 使用 jQuery 建立簡單插件
- 向儲存中添加物件、陣列、圖像和 TTL 支援
- 調整瀏覽器的 local storage 空間

方法
本書充滿實用的逐步指導和對最重要、最有用任務的清晰解釋。完成工作並在過程中學習。逐步食譜幫助您掌握 LocalStorage 標準。