Check Browser JavaScript & Cookies Enable Or Not
23:43Introduction
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 > Asp.net enpty web site > Enter the name of the Application "Jquery_Check_Disabled_Javascript_Cookies" > OkNow take a (Test.html) page and replace the following code:
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <script> if (navigator.cookieEnabled) alert("Cookies Enabled !!!"); else alert("Cookies Disabled !!!"); </script> </head> <body> <noscript> <div class="noscriptmsg" style="font-weight:bold;font-size:20px;text-align:center;padding:20px;"> Please enable javascript in your browser !!! </div> </noscript> </body> </html>
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:
0 comments