Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modernizr causes errors with jQuery Isotope

I'm trying to add Modernizr to this page: http://www.alternativeradio.org/pages/test. Modernizr works fine and does its job on other pages of this site. But on this page, which uses jQuery Isotope, adding:

<script src="http://cdn.shopify.com/s/files/1/0070/7142/t/1/assets/modernizr.custom.js?128259" type="text/javascript"></script>

to the HEAD causes two Javascript errors to appear:

.   Uncaught TypeError: Object #<Object> has no method 'addTest' jquery.isotope.min.js:11
.   Uncaught TypeError: Object [object Object] has no method 'isotope' free-downloads:2151

I tried loading jquery.isotope.min.js via Modernizr.load, to no avail. What am I missing? Thanks!

like image 848
Zade Avatar asked Jun 17 '12 23:06

Zade


1 Answers

I figured out the problem. I was using a build of Modernizr without Modernizr.addTest, and although Isotope includes its own version Modernizr that works by itself, loading Modernizr prior to Isotope without Modernizr.addTest caused this issue.

like image 103
Zade Avatar answered Oct 31 '22 14:10

Zade