I have included this code in my script. Can someone tell me step by step how to install Modernizer in a page, in English layman point of view?
if(Modernizer.geolocation){
alert("geolocation is supported");
}
I have included this code in my script. Can someone tell me step by step how to install Modernizer in a page, in English layman point of view?
if(Modernizer.geolocation){
alert("geolocation is supported");
}
Copyright © 2021 Jogjafile Inc.
"Modernizr is not defined" happens when you try to reference it somewhere in a code but have not included it previously.
You may have your
call before
Modernizris included, or you have not included it at all. There is also a case whenModernizris included but within asynchronous script (in that case, there might be something like<script src="modernizr.js" async></script>).How to include Modernizr - the easiest way?
First choose your detects - a set of features your custom built version of
Modernizrwill test: https://modernizr.com/downloadThan save it as
modernizer.jssomewhere in your source tree, for example'js/modernizr.rs'. Include it in ascripttag before firstModernizrcall. Like: