čtvrtek 3. prosince 2015

How to check if cookies are enabled

The navigator object has the attribute cookieEnabled that returns true if the cookies are enabled in the browser. Find a simple example bellow.

<HTML>
<HEAD>
  <SCRIPT>
    function checkCookies(){
    window.alert("Are cookies enabled? "+(navigator.cookieEnabled?"Yes":"No"));
    }
  </SCRIPT>
</HEAD>
<BODY>
  <BUTTON onclick="checkCookies()">Check cookies</BUTTON>
</BODY>
</HTML>



Žádné komentáře:

Okomentovat