“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

  • Earn Money From Social Networks

    Social Networks had been created to help bloggers stay connected with others and build social community. It allows you to submit your own articles or stories. Each stories will be linked to your site and drive a lot of visitors to your blogs. Nowadays, there are a lot of Social Networks on the inte
  • See Your Friend's Recent Activity Through Dashboard

    I have been inspired by FaceBook's friendfeed and now i just has done my plugin about it. The plugin is called WP Friend Feed. The function is still simple. It will fetch your friend's feed and display 10 most updated feed on the dashboard menu. If you want to add some friends, just add it through
  • Play Casino Online

    Most people can be pleased by playing Casino. In most jurisdictions worldwide, gambling is limited to persons over the age of license (18 or 21 years of age in most of the United States and 16 to 21 in most other countries where casinos are permitted). Customers gamble by playing slot machines or
  • How to Insert Animation on Javascript

    Today, the appearance of websites are better than before. They are more complex in HTML codes and CSS styles to have better look. Javascript has grown widely. Almost every pages uses javascript. It maybe using javascript for implementing AJAX or for implementing advanced dynamic appearance. Good an
  • How to Save More MySQL Space Using WordPress Plugin

    WordPress is a big and sophisticated blog platform. The feature are so many. While you are writting a new post, you may notice that the post is autosaved periodically per minutes. The autosave is a useful feature so you won't lose your current post if your computer is out of power. The autosaved po

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