$(function(){
$('body').on('click', '.queue', function(event) {
var video = $(this).closest('.video');
console.log(video);
var queue = localStorage.getItem('queue');
if (! queue ) {
queue = [];
}
queue.push(video);
localStorage.setItem('queue', queue);
console.log(localStorage.getItem('queue'));
bootstrap_alert.success('queued!');
});
});
当我尝试对此进行测试时,我在控制台上收到错误消息
TypeError: queue.push is not a function
queue.push(video);
我在这里做错了什么?