2

I was wondering how you could test for multiple features in modernizr. I know you can do:

if(Modernizr.websockets) { // has websockets } else { // no websockets }

But I was wondering how to test for multiple features. I have tried many common JavaScript syntaxes and I've also google'd it and cannot seem to find an answer. The reason I'm asking is because what I think would normally work, isn't working.

Here's what I'm currently doing:

if((Modernizr.cssgradients)|(Modernizr.fontface)|(Modernizr.rgba)) { var pass = true; }

Any ideas on what I am doing wrong?

4

0 回答 0