Modernizr causes errors with jQuery Isotope
Asked Answered
M

2

7

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!

Mortification answered 17/6, 2012 at 23:10 Comment(0)
M
9

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.

Mortification answered 18/6, 2012 at 20:53 Comment(0)
I
0

That's a pretty cryptic error. Try loading a non-minified version of jQuery isotope and a non-minified version of Modernizr and see if it gets more descriptive. Given the "#" in the message, I'd also look for jQuery selectors that yield no results.

Inverter answered 18/6, 2012 at 20:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.