The direct answer to the question: "Yes!" and it is built in
Code example:
if (Modernizr.cookies == false) { alert('Please enable cookies'); } else { // do something with cookies }
You can also use the css .cookies or .no-cookies class to show / hide the panel informing the user that they need cookies.
.cookies #noCookies { display: none; } <div id='#noCookies'> This site requires cookies! Please turn them on already! </div>
(This .cookies class has .cookies added to the <body> from Modernizr).
Note. If you are creating a custom assembly of Modernizr, the cookies option is currently "hidden" in the "Conventional definitions" section.
Simon_Weaver
source share