嗨,大家好,请你告诉我如何访问audioCollection对象内的内容?jQuery访问对象值
我使用Echonest jQuery插件使用jQuery模板
https://github.com/Rodeoclash/Echonest-jQuery-Plugin/blob/master/scripts/echonest.js
我去萤火虫和类型化console.log(audioCollection)
和我得到ReferenceError: audioCollection is not defined
。不知道我是否做得对。
echonest.artist(artist).audio(function(audioCollection) {
$('#blog-page').find('.post').append(audioCollection.to_html('<p class="song-url" style="display:none;">${url}</p>'));
//appends url variable to html inside of audioCollection
var testing = audioCollection; //returns [Object object]
});
谢谢!
你究竟在哪里放了'console.log(audioCollection)'? – 2011-02-28 21:19:05
你在使用一些插件吗?如果是,哪一个? 'audio'不是标准的jQuery函数。你必须提供更多信息。 – 2011-02-28 21:19:31
'audioCollection'只存在于其封闭函数的范围内。这就是为什么你无法使用Firebug从全球范围获得它的价值。 – 2011-02-28 21:22:19