Subscibe our Newsletter for FREE and stay up to date with our daily lesson*

“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 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. :-)

What is in your mind ?

Subscribe Me

Learn more the basic tips about WordPress and PHP coding. You can subscribe to our Newsletter to stay in touch with every new stories FREE

Sponsors

WooThemes - Where there's a Woo, there's a way!

Our FaceBook (new)


Discussion Topics

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 need anything, then submit it on Contact Us. If you feel satisfy with my work, please support me to keep it developed

Our Community

Discussion

sobsy

Thanks in advance for your help!

Hilongosnon

Very well done, I will use this kind of plugin on my comments in my website.. thank you for sharing

point desi

dear admin, i installed you auto keyword plungin at my wordpress blog. its really nice. but it work
Close