To begin with, look at how to use localStorage to store the tweets locally.
首先来看如何使用 localStorage 来本地存储 tweet。
The loadLocal function takes a keyword, as this is used to find the relevant tweets in the localStorage cache.
loadLocal 函数接受一个 keyword 作为参数,该关键词也被用于在 localStorage 高速缓存中寻找相关 tweet。
Once again, you do some browser capability detection, by first checking if the window object has the localStorage property, per the HTML 5 specification.
同样,这里做了一些浏览器功能检查,按照 HTML 5 规范,首先检查 window 对象是否有 localStorage 属性。
应用推荐