i have to detect with JS (jQuery) wether a browser supports Woff and then add a class to the body. Something like this:
if(woffIsSupported){
$('body').addClass('modern');
}
is this somehow possible? Thank you for your answers.
i have to detect with JS (jQuery) wether a browser supports Woff and then add a class to the body. Something like this:
if(woffIsSupported){
$('body').addClass('modern');
}
is this somehow possible? Thank you for your answers.
Because it's hard to test that I'm using just the browser detection:
It matches the usage: http://caniuse.com/#feat=woff
There's a function on this post called
isFontFaceSupported
that checks for support based on browser features (the good way, i.e. not relying on the user agent string).Copy that function and your code can become:
Here is the function from the post: