0

I'm more than a little confused about Modernizr and it's relation to Yepnope.js. As I understand it, Modernizr comes with Yepnope.js (assuming you select the Modernizr.load() option). According to the Yepnope documentation, there are optional prefix plugins which can used. For example, you can test for versions of IE (assuming you also load the yepnope.ie-prefix.js script). However, when I attempt to run the following, I get 'undefined' alert:

Modernizr.load({
   load: 'ie!my-ie-specific.js',
   complete : function (url, result, key){
     alert(url, result, key);
 }
});

What am I doing wrong? Does Modernizr include Yepnope completely or only bits and pieces?

skube
  • 5,867
  • 9
  • 53
  • 77

1 Answers1

0

I got stuck on this too. Struggled for an hour.

The complete callback doesn't support tests. Change it to callback which fires when the external script is loaded.

complete runs when all scripts are loaded, OR if nothing is loaded.

I wish complete took the result variable though. I could use that.

Brian Hogan
  • 3,033
  • 21
  • 18