How to detect that JavaScript and/or Cookies are disabled?

前端 未结 9 1187
鱼传尺愫
鱼传尺愫 2020-11-27 14:13

How to detect that JavaScript or Cookies are disabled in the user\'s browser and notify him any help ?

9条回答
  •  無奈伤痛
    2020-11-27 15:16

    This is the easiest way

    if (navigator.cookieEnabled) {
    document.write("Cookies Enabled");
    } else 
    {
    document.write("Oops Cookies Not Enabled");
    }
    Check if Cookies Enabled in Your Browser:  
    

提交回复
热议问题