Javascript Noscript User Block

Javascript Noscript screenshot
screenshot

This article shows how to block website content from users and guests that have javascript disabled. Though there are several techniques, this is one of the easiest and simplest.

Why Disable Javascript?
People disable their browser javascript for several reasons: to save on bandwidth, improve browser speed, security fears against malevolent sites, not wanting to leave footprints (such as Google Analytics tracking), to block advertisements, accessibility issues such as being blind, and simply because they can. In the mindset of the user, each of these reasons are valid.

How Noscript Works
Noscript serves as a Browser messenger to notify the user that scripting has been disabled in their web browser when the script is being called for in the webpage. It's simply an alternative (or "alt") content in place of the missing javascript.

When To Use Noscript
We use noscript to block selective page content such as "a href" links. It's believed that most users with javascript disabled are those (1) avoiding advertisements, (2) who want to avoid Analytics tracking footprint data, and (3) who want to improve webpage load times.

It isn't important whether you agree or not with the manner or method we use noscript here. What is important is its' design and effectiveness.

It's arguably agreed that using an image rather than text for your noscript message if far more safer in terms of SEO and page rank.

Place the following noscript code snippet anywhere in your page between the <body> and </body> tags:

<noscript>
<img src="your-image.jpg" alt="noscript" />
<style type=text/css> a, .navigation, #search { display:none; }</style>
</noscript>

The above code in the style line is telling the browser to NOT display any a href links, hide the division class "navigation", and hide the division ID "search". With the above code you need to change the image and include any of YOUR page divisions you wish to not have displayed.

Best wishes! and happy blocking.


Add Comment

Visitor Comments (1)

Topic: Javascript Noscript
Full StarFull StarFull StarFull StarFull Star 5/5 (1)
Facebookdel.icio.usStumbleUponDiggTechnoratiGoogle+RedditMySpaceTwitterLinkedIn
Full StarFull StarFull StarFull StarFull Star
Tom C. says...
Disable your Javascript and give it a try. This script is actively working on this page.
16th December 2014 5:41am
Page 1 of 1
Norton SafeWeb   Creative Commons License   search button