I have 3 test conditions for Modernizr.load.
Currently if A, B, and C are all false, then they are all loaded, whereas I only want A and B to be loaded.
How can I test for both true and false conditions in the same "test:"?
My code looks like:
Modernizr.load([
{
test: Modernizr.A,
nope: 'A.js'
},
{
test: Modernizr.B,
nope: 'B.js'
},
{
test: !Modernizr.A && !Modernizr.B && Modernizr.C,
nope: 'C.js'
}
]);
I was able to accomplish this like so:
Modernizr.load([
{
test: Modernizr.A,
nope: 'A.js'
},
{
test: Modernizr.B,
nope: 'B.js',
complete: function() {
if ( Modernizr.A && Modernizr.B ){
Modernizr.load({
test: Modernizr.C,
nope: 'C.js'
});
}
}
}
]);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.