Skip to main content

Posts

Showing posts from May, 2012

Check javascript is enable or disable

Hello there In our genreal practice of developing a webpage we use JAVASCRIPT. But do you know what will happen when in clients' browser javascript is disable and in your webpage you used it ?? Nothing will happen as per your expectation. It is good programming practice to check JAVASCRIPT is disabled or not . For example  <noscript>   <meta http-equiv = "refresh" content = "1;url=error.html" > </noscript>   This will redirect to an error page if script is disabled. Just replace error.html with the url of your error page. Or you also can do this   <noscript> <blink>Please enable javascript</blink> </noscript>    

Check cookie is enable or disable

Hello there In our genreal practice of developing a webpage we use COOKIE. But do you know what will happen when in clients' browser cookie is disable and in your webpage you used it ?? Nothing will happen as per your expectation. It is good programming practice to check cookie is disabled or not . For example  <script type="text/javascript">           var cookie_en = navigator.cookieEnabled;           alert(cookie_en);      //  this alert true or false , if cookie is enable it alerts true otherwise false                 if(cookie_en == 0)                     alert("You need to enable cookies for this site to load properly!");         </script>