Check Browser JavaScript & Cookies Enable Or Not



In this atricle I want to show how to check browser javascript & cookies enabled or not.

Create Simple Application

Go to Visual Studio > File > New > Web site > enpty web site > Enter the name of the Application "Jquery_Check_Disabled_Javascript_Cookies" > Ok
Now take a (Test.html) page and replace the following code:
    <!DOCTYPE html>
 <meta charset="utf-8" />
        if (navigator.cookieEnabled)
            alert("Cookies Enabled !!!");
            alert("Cookies Disabled !!!");
        <div class="noscriptmsg" style="font-weight:bold;font-size:20px;text-align:center;padding:20px;">
            Please enable javascript in your browser !!!

Run The Application (In Google Chrome)

After run the application, if our browser cookies enabled, then it show the below image:

If our browser disabled javascript, then show the following image:

How To Disabled Javascript In Google Chrome

Go to Settings > Click "Show advanced settings…" > In the privacy group, click "content settings..." > Check "Do not allow any site to run Javascript" > Done


You can download application zip file here - 2 KB


If you have any question, please leave a comment.

You Might Also Like