嗨,我是浏览器的新手,并且一直在添加我的代码以使其更加结构化,我阅读了添加JQuery插件的文档,但由于某种原因,我在尝试添加'infinite-ajax-scroll时遇到以下错误'插件作为“模块”。
修改:插件来自这里: https://github.com/webcreate/infinite-ajax-scroll
我一直收到以下错误:
未捕获的TypeError:jqueryIas不是函数
这是我的档案:
var $ = require('jquery');
window.jQuery = $;
global.$ = require('jquery');
var jqueryIas = require('../plugins/jquery.ias.min.js');
var moduleListings = (function() {
(function($tvshow_episode_listing){
if($tvshow_episode_listing.length)
{
var ias = jqueryIas({
container: '#tvshows-episodes-listing',
item: '.m-listing-item-row',
pagination: '.m-pagination-tvshow',
next: '.next-page-link'
});
ias.extension(new IASSpinnerExtension({
src: '/templates/default/images/loader.gif',
html: '<div class="ias-spinner l-listing-loading"><img src="{src}"/></div>'
}));
ias.extension(new IASNoneLeftExtension({
text: '',
html: ''
}));
ias.extension(new IASTriggerExtension({
offset: 1,
text: 'Load More Episodes',
textPrev: 'Load Previous Episodes',
html: '<div class="ias-trigger ias-trigger-next l-tvshows-listing-nav l-episodes-listing-nav l-tvshows-listing-nav-next"><a>{text} <em class="f-tvrocks icon-chevron-down"></em></a></div>',
htmlPrev: '<div class="ias-trigger ias-trigger-prev l-tvshows-listing-nav l-episodes-listing-nav l-tvshows-listing-nav-prev"><a><em class="f-tvrocks icon-chevron-up"></em> {text}</a></div>'
}));
ias.extension(new IASPagingExtension());
ias.extension(new IASHistoryExtension({
prev: '.prev-page-link'
}));
ias.on('rendered', function() {
$('.ajax-watched-listing-toggle').off( "click");
toggle_watched_episode( $('.ajax-watched-listing-toggle') );
$('.tooltip').jBox('Tooltip', {
theme: 'TooltipDark'
});
});
}
})($('#tvshows-episodes-listing'));
});
module.exports = moduleListings;
我有什么想法可以在browserify中要求这个插件吗?