Chrome扩展程序回调?
|
我正在开发我的第一个Chrome扩展程序。我想我需要学习如何做回调。在使history.getVisits()有用时,遇到了麻烦。
我可以很好地检索HistoryItems,但是我不知道如何将VisitItems与HistoryItems结合使用。
chrome.history.getVisits({url:historyItemUrl}, function(visitItems){
// I can loop through the visitItems, but...
// how can I access the historyItemUrl from in here?
// do I need to make a better function for the 2nd param?
});
我已经看过并尝试了SO中的许多回调示例,但是当我尝试使用自己的回调函数时,JS控制台一直在讲关于在getVisits()
中要求第二个参数的说法。我想我真的只是缺少回调的概念。
如果可以的话请帮助-谢谢!
没有找到相关结果
已邀请:
1 个回复
亨尖玛次酥