Modernizr.load (yepnope.js) IE conditional confusion
Asked Answered
I

1

5

In the following code dd_belatedpng.js is loading despite the fact that I'm using Firefox 4.0.1. According to the yepnope.js documentation, the ielt7! prefix should cause the script only to load if the browser is IE less than version 7. Is this functionality removed from the Modernizr.load implementation (I believed that one was just an alias for the other), or a bug, or, as I suspect, me just missing/misunderstanding something obvious? Thanks for your help. Here's the code.

Modernizr.load([
    {   
        load: '//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js',
        complete: function() {
            if(!window.jQuery) {
                Modernizr.load('/inc/jquery-1.6.1.min.js');
            }   
        }   
    },  
    {   
        load : 'ielt7!/inc/dd_belatedpng.js',
        callback: function() {
            $(function() {
                DD_belatedPNG.fix("img, .png_bg");
            }); 
        }   
    }/*,
    'jquery.plugins.js',
    'my.scripts.js'*/
]);
Ichnite answered 12/6, 2011 at 0:30 Comment(0)
P
8

You probably forgot to include the yepnope.ie-prefix.js file.

Proglottis answered 12/6, 2011 at 6:19 Comment(2)
You're a star, thanks. I was scratching my head over this for a while. Is it just me though or is there no mention of needing (or link to) this on the yepnope.js site. Strange, but problem solved. Thanks.Ichnite
Yeah I was thinking the same thing! They don't mention it at all in the documentation nor is there much info out on the internets.Krystalkrystalle

© 2022 - 2024 — McMap. All rights reserved.