English 中文(简体)
是否在 Java本制造购物车时使用库克群岛或届会储存?
原标题:Are there any alternatives for using Cookies or Session storage when creating a shopping cart in JavaScript?

即便是那些阻挡了厨师的人们也能进入一个电子商务网站,在创建传统购物车以储存其他地方的汽车数据时,在用户购物时,是否还有其他选择?

问题回答

On modern browsers, localstorage can be used. For details, please refer to: https://javascript.info/localstorage

现代浏览器为用户系统当地储存数据提供网络信息预报器,其容量至少为5个用户,数据从来不像厨师那样转给服务器。

WebStorage API provides two object for storing data on the client:

  • window.localStorage - stores data with no expiration date
  • window.sessionStorage - stores data for one session (data is lost when the browser tab is closed)

https://www.w3schools.com/html/html5_webstorage.asp

https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API

Modern browsers also provide IndexedDB API to storage of significant amounts of structured data on client system. This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data.

https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API

WebStorage API store and retrieve data as synchronize which means make main threat of web page blocked until data stored or retrieved. But operations performed using IndexedDB are done asynchronously, so as not to block applications.





相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签