摘要
购物车是电商平台的一项标准重要功能。该文通过对比分析以往购物车设计中采用cookie和session方式的优缺点,提出了把购物车数据规范为JSON格式后,在HTML5标准下采用localStorage方式存储、修改和展示,以及如何与服务器交互实现购物车数据的持久存储。
Shopping cart is a standard and important function of the electronic business platform. By comparing and analyzing the advantages and disadvantages of using cookies and sessions in the past shopping cart design, this paper gives a method of storing, modifying and displaying the shopping cart data in JSON format by using localStorage under HTML5 standard, and how to realize the persistent storage of shopping cart data by interacting with the server.
出处
《电脑知识与技术》
2018年第12Z期269-270,272,共3页
Computer Knowledge and Technology