mardi 26 décembre 2017

How to check if FontFace prototype exists in Edge

I am using FontFace to preload fonts, it's working ok on chrome, but it stops page in Edge because FontFace is not defined in Edge.

How can I check if FontFace class prototype exists ( in JavaScript) so I don't construct it in Edge?

(I know FontFace prototype doesn't exist in Edge, but just wanted to prevent page from crashing by skipping using FontFace in Edge)

I tried this, but doesn't work in edge, it crashes.

if (typeof FontFace != undefined)
{
....
}




Aucun commentaire:

Enregistrer un commentaire