简体   繁体   English

JavaScript:将播放列表存储在内存中

[英]JavaScript: Store a playlist in-memory

I'm trying to store a playlist of songs in my application. 我正在尝试在应用程序中存储歌曲的播放列表。 What's the most flexible and efficient way to do this? 最灵活,最有效的方法是什么? Each song has a few fields, like: song_name, song_id, song_artist etc. The playlist is sent to the client as JSON. 每首歌曲都有几个字段,例如:song_name,song_id,song_artist等。播放列表以JSON的形式发送到客户端。

Dustin Dias has a nice cache script that stores the values as json either as an simple javascript object variable or in window.localStorage: Dustin Dias有一个很好的缓存脚本,可以将值作为json作为简单的javascript对象变量或在window.localStorage中存储:

http://www.dustindiaz.com/javascript-cache-provider/ http://www.dustindiaz.com/javascript-cache-provider/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM