“Please Enable JavaScript” Message

In this tutorial, i will show you how to simply display message when users don’t enable JavaScript on their browser. Why am i telling this for you? Look, it is 2009. Nowadays there are a lot of widgets, web services, and ads running under JavaScript manipulation. So, if your visitor disable JavaScript while browsing your [...]

In this tutorial, i will show you how to simply display message when users don’t enable JavaScript on their browser. Why am i telling this for you? Look, it is 2009. Nowadays there are a lot of widgets, web services, and ads running under JavaScript manipulation. So, if your visitor disable JavaScript while browsing your pages, you must be missing a lot of advantages like:

  1. Advertisement
  2. Web Counter
  3. Web Stats
  4. Traffic Analytic
  5. AJAX animation, and so on…

So let’s get started and put the message on your page which will displayed when JavaScript is disabled and hidden when it is enabled. To do it so, you will need to use either simple <noscript> html tag or using JavaScript element hider.

  1. Using NoScript HTML Tag

    It is really a simple task to do. Just type your message inside <noscript> as usual and common HTML element. Code:
    <noscript>Please enable your JavaScript for better view</noscript>

  2. Using JavaScript Element Hider

    This method require both <script> and container tag like <div> , <p> , <span> , et cetera. First, make a message inside container with id = “js-disabled” and the code goes:
    <div id = "js-disabled">Please enable your JavaScript for better view</div>
    <script>
    disabled = document.getElementById("js-disabled");
    disabled.style.display = "none";
    </script>

OK, that’s for the basic implementation. :-)

Posted on , , , ,

Bookmark and Share

Comments are closed.


AJAX Random Post

  • Beware of FaceBookSter

    Recently there is a site on facebookster.net that send spam message to some of my friends. I just want you to beware and just ignore it or mark it as spam. It really is a web phising with the FaceBook mask to disguise in. FaceBookSter uses the popularity of FaceBook and Friendster to do their work.
  • New Blog: Where To Start

    If you have created a new blog just now and don't know what to do to "introduce" it on the world wide web, then please at least hear my suggestion about it. All you have to do when your blog is ready to the world is start a promotion step by step. Give It Some Contents To be listed in major se
  • AdMob has been acquired by Google

    On November 9th, 2009, AdMob has been acquired by Google. After 7 years of serving ads for both mobile sites and mobile devices application, now AdMob is the part of Google incorporation. Google bought AdMob for $75million. That's a pretty big amount of earnings for sure. From the AdMob's blog, they
  • Recent Posts For Blogger

    This is just the little tutorial for those who want to show their recent post links to sidebar or widget on Blogger. You just have to login to your dashboard > layout > insert rss widget. Enter your current blog's feed address, usually it will be http://yourblog.blogspot.com/rss/default/
  • Link Bar For Blogger

    Have you ever think about installing forum-like blog ? As I know, most of forums online today has the linkbar to show the current article and the position of the reader read. This plugin is created for Blogger/Blogspot users. The function is to parse the current URL based on / in your blog url to h

References

Who am I ?

My name is Julian Widya Perdana. I study at University of Gadjah Mada, Yogyakarta. I am a young developer addicted in JavaScript, Plugins, Themes, AJAX, and PHP developement. If you feel satisfy with my work, please support me to keep it developed