What the heck am I going to do about the 6% of visitors who've got JS disabled??

The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

My retail site uses a DHTML menu at the top of the page as the main navigational system. There is also a text-only menu at the bottom of the page, but it's not the first thing that people will see. I'm seeing on the stats that about 6% of our visitors have JavaScript disabled. So, basically, I am currently crippling the navigation for 6% of the site's visitors. What am I going to do?? I also need to make sure that it doesn't take a million clicks for people to find things--thus, the DHTML menu, which makes the navigation really fast.

And I just don't have the extra time to spend developing all sorts of detection and alternate site pages. (Not to mention that I don't have that option with the shopping cart software.) But what am I going to do? Any suggestions?

you could make a new menu direct people with js disabled or just get a new navbar nothing to hard i guess , are you sure its 6% of your site or not 6% of the internet. if its the internet well then dont worry they probaly have a 2k connection and wont use your site unless its a advice page for 2k surfers

No, it's definitely 6% of my visitors--from my WebTrendsLive stats. I would've thought that our visitors were LESS likely to have JS disabled. But I was wrong. (Maybe that means we're selling to a tough crowd?)

Originally posted by freddydoesphp I say make them turn JS back on to view your site, I mean we are only talking 6% here, maybe something on the site that says this site is best viewed with js turned on.

In this case, "Only usable with JS turned on."

Do nothing. These 6% will stop coming and you won't have anything to worry about any longer.

If you want to service 100% of the people who visit your site, you will need to supply them with text-only, no frills pages. Most of us will never do that.

You make your choice every time you design a page with anything more than simple HTML.

What you could do is create an HTML interface and put it in a div that is automatically set invisible and/or moved off the page as soon as the javascript to create the DHTML is executed. You could then set a cookie using javascript, and use a server-side scripting language such as PHP to check for the cookie, and only display the inital HTML version if the cookie doesn't exist.

Are you talking about Java or Javascript? As far as I know you can't disable JS in IE - only in Netscape.

If you want to cater for non-JS users, use the <noscript> tag.
Put into the <head> of your documents with a <meta> refresh url to redirect them to an alternative page. It's sooo easy, and it's very kewl. E.g. ...

This also works a treat if the version of JS is more modern than the browser can support. For example, the sexy "switch" statement requires a Javascript1.2 enabled browser to work, which includes version 4 browsers. Javascript1.3 requires NS4.5 or above and so on.

i suggest going with a navbar that is not completely dhtml. for example, on my site (http://www.psitanksdev.com, its not completed yet, hence the dev in the url) the navbar are regular images that point to the dhtml script, in this case, the hiermenus from dhtml.com. it doesn't matter whether anyone has js on with my site, they can still click on the images and be taken to the page. i also provided text links on the left that are redundant to the dhtml menu.

Lucas, there's more to a JS enabled site than just fancy navigation systems. Even if you include a non-JS navigation element in your site, much of what you may want to do cannot be achieved if they don't have JS enabled.

You really need to get round this by redirecting them to a page which explicity tells them to enable JS (at least on NS, anyway).

Originally posted by Scot-Bot Lucas, there's more to a JS enabled site than just fancy navigation systems. Even if you include a non-JS navigation element in your site, much of what you may want to do cannot be achieved if they don't have JS enabled.

while thats true, you first have to give a reason for a person to turn on JS. if they can't even navigate through the site to see what they are putting in the extra 15 seconds to turn on JS, then they will leave. remember, when the people show up to her site with JS turned off, they are not going to see any navigation at all, and they are going to be confused. at least it should be possible to navigate with it turned off, and then there should be a note to turn it on when going into more advanced features. (aka shoppingcart).

sending the user directly to a page telling them to turn on JS, (which btw uses a js redirect, which means it wouldn't work for the user) will make them leave in a heartbeat. i know i would.

Lucas, you don't need Javascript to redirect a user. Please refer to one of earlier posts in this discussion, i.e. the one about the <noscript> tag.

Nonetheless, you make a moot point. Certainly, users want to see some content in order to be interested in your site, but they still need to know that JS has to enabled to enjoy the site to its fullest. It is still possible to combine both methods.

Many sites use ASP, JSP or CGI at the server to write the page for the browser. This avoids the problem of Java disabled browsers.

If one must work on the client side and avoid losing 6% of their customers then the site has to be a strict HTML site.

I have some sites that are highly dependent on Java and I cannot work on the host side. So, to provide compatibility for Java disabled browsers I have an incoming page with a very short script that says:

location.replace( "Java");

If they are Java disabled this does nothing. If they are Java enabled it takes them to the Java based page. I use REPLACE to avoid creating a mouse trap effect with the Back Button.

Use the plain HTML in place of the web store's standard page and customize a copy for the Java page. Just make sure they are not passing info in their URL calls from page to page.

Listen, there's a difference betwen Java and Javascript. Java is for cross-platform development and applets, whereas Javascript is for browser stuff. If you want to abbreviate Javascript say JS, but Java is something entirely different.

Browser versions on the site: 72% are using IE 5.x, 8% using some other IE version, 15% are using Netscape 4.x, "Other Netscape Compatible" is 3.5%, and the rest are variations of Netscape. I don't have a statistic available that says X number of users with this browser have JS support, X number don't.

Alex, that's a good tip. In this case, though, the DHTML menu doesn't show up at all. And my stylesheets don't get applied because I'm detecting the browser with JavaScript. (I care a lot less about that, because the page is still readable and clickable, even if it's uglier. The formatting is still intact because it's in tables.)

I think <noscript> can be used in the body of a document, can't it? Is it possible to use it to write a navigation table? So if the table is included within the <noscript> tag, it is only written if the user doesn't have JS support? I think that would be the easiest solution, and then I can use SSI to include the noscript file on each page and it will be less of a pain.

Sarah, in my experience using the <noscript> in the body is a bad idea, since it will draw the extra material on top of the rest of your document, i.e. that is the non-JS user will be able to see both non-JS and the JS-enabled interface. You don't want to do this. It will look awful.

You'd better use it in the head of the document. If you're worried about writing double the content, then use server side includes for body content, that way you only have to write it once.

Okay, this has been an extremely interesting debate to read, but Scot-Bot's last comment has me confused.

How can a user with JS disabled be able to see JS content? Explain your logic, please.

I've used <noscript></noscript> in the body of my HTML and never seen what you are describing. Not to say it can't happen -- I just need more details so I can try and replicate what you are talking about.

As far the ongoing discussion of providing alternative content for users, I think that's a business decision that each web designer needs to make on her or his own. Some may choose to say 'screw you' to folks with older browsers -- in fact, I've done this to some extent myself with how I use CSS, but visual niceties are a different beast than navigational devices, which is a critical usability issue. SLeon asked for help for her users' sake, and 'screw you' doesn't seem to be the best advice.

Dougie, when I said they saw both non-JS and JS-enabled content, I meant that the browser would write the <noscript> content over-the-top or underneath the rest of the content that was orginally there - it wouldn't write it instead. I didn't mean that the Javascript would work!

(1) Suppose you've got this code.

<body>
<noscript>
<p>blah, blah, blah </p>
</noscript>

<p>rhubarb, rhubarb, rhubarb </p>
</body>

If the browser is JS-enabled, the user will only see the "rhuarbarb" text.

However, if JS is not working, then the user will see both the "blah" text and the "rhuarbarb" text. Any JS that exists won't work, but the content will still be there. That's what I meant.

If, the <noscript> tag appears above the main content, then the "blah" content will appear first. But if the <noscript> tag comes after the main content, then the alternative content will come at the end of the document.

(I'm talking from experience here. The experience of others may, of course, differ!)