我正在使用Crossrider API开发浏览器扩展。
我想为 Crossrider local database 中的同一个键添加多个值,
crossrider支持的方法是appAPI.db.set
appAPI.db.set(key, value, [expires])
但我想保存许多值,例如:
appAPI.db.set('a.html',5,10,300)
它以一个值作为参数,如何为同一个键存储多个值?
最佳答案
appAPI.db.set( 'a.html', [5,10,30], [expires] )
然后检索它:
var myValues = appAPI.db.get('a.html');
关于javascript - 如何为同一个键设置多个值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15241132/