HTML and CSS Reference
In-Depth Information
Uncaught TypeError: Object [object Object] has
no method 'smoothScroll'
This is because we invoke the plugins from main.js but we have not included those
plugins here because we are not testing them. We can corral all of our plugin-de-
pendent code and invoke them only if QUnit is not used, by testing for the existence
of QUnit first before invoking plugins and frameworks like in the following snippet of
code:
if(window.QUnit == undefined) {
$('.js-scrollitem').smoothScroll();
if(Modernizr.svg === false) {
$('img[src$=".svg"]').each(function() {
this.src = /(.*)\.svg$/.exec(this.src)[1]
+ '.png';
});
}
if (Modernizr.generatedcontent === false &&
window.onbeforeprint !== undefined) {
window.onbeforeprint = printLinkURLs;
window.onafterprint = hideLinkURLs;
}
Modernizr.load({
test: Modernizr.audio,
nope: {
'mediaelementjs': 'js/vendor/mediaelement/
mediaelement-and-player.min.js'
},
callback: {
'mediaelementjs': function() {
$('audio').mediaelementplayer();
}
}
});
}
Search WWH ::




Custom Search