localstorage
-
This can be very useful for debugging applications that use localStorage .
这对于调试使用localStorage的应用程序非常有用。
-
Next , you attempt to load existing tweets from localStorage .
接下来,试图从localStorage加载现有tweets。
-
The two objects share the same API , so I shall focus on localStorage only .
两个对象共享相同的API,所以我将只着重介绍localStorage。
-
This is necessary since localStorage only stores strings .
这是很必要的,因为localStorage只存储字符串。
-
This is in contrast to localStorage , which spans multiple user sessions .
这是与localStorage相对的,后者跨多个用户会话。
-
Now take a look at an example that demonstrates how to use localStorage to achieve this kind of caching .
现在来看一个例子,演示了如何使用localStorage来获得这种高速缓存。
-
If localStorage is supported , then first check to see if the tweet is already stored .
如果localStorage受到支持,那么首先进行检查,看这个tweet是否已经存储。
-
With localStorage , you can easily cache data from your servers , on the client 's local machine .
利用localStorage,可以在客户机的本地机器上容易地从服务器高速缓存数据。
-
To begin with , look at how to use localStorage to store the tweets locally .
首先来看如何使用localStorage来本地存储tweet。
-
You start by getting the total number of items stored in localStorage and then iterating over them .
您首先得到存储在localStorage中的条目的总数,然后再迭代这些条目。
-
This article uses the same approach to create and update records as that used in Part 1 ( when you stored the offline data in localstorage ) .
本文使用第1部分中使用的相同方法来创建和更新记录(当您将离线数据存储在localstorage时)。
-
The loadLocal function takes a keyword , as this is used to find the relevant tweets in the localStorage cache .
loadLocal函数接受一个keyword作为参数,该关键词也被用于在localStorage高速缓存中寻找相关tweet。
-
So if you only have to worry about those browsers , then localStorage is a viable option .
因此如果只担心浏览器的话,localStorage将是一个可用的选项。
-
Just after Geolocation are the offline app capabilities including cache manifests and localstorage , because mobile apps need to work when the network isn 't available .
排在地理位置后面的是离线应用功能,包括缓存manifest和本地存储,因为移动应用在网络不可用时也需要工作。
-
As mentioned earlier , localStorage is widely supported in both desktop and mobile browsers , but it is always a good idea to check when using a new feature like this .
正如前面所提到的,localStorage在桌面和移动浏览器中都受到广泛支持,但是在使用这样的新特性时进行检查总是一个好主意。
-
Now that you have started saving the tweets coming from Twitter 's search APIs so that they can be used as a cache , you just need to start reading them from localStorage .
既然您已经开始保存来自Twitter的搜索API的tweet,以便它们可以被用作高速缓存,所以您只需开始从localStorage读取它们即可。