Lukon
Lukon

Reputation: 265

Redirecting to another site if Javascript is disabled? Coding with disabled script users in mind?

So I've spent the entirety of today trying to figure out the best approach in preparing to re-design our business website with the expectation that less than 1% of the people browsing the web have JS disabled.

It is the general opinion of our management team that we would like to have our website be functional if the user does not have any JS capabilities or has them disabled for whatever reason. Now, I am aware of the concept of both graceful degradation and progressive enhancement; but both methods feel as if they would make the design process rather complicated and truthfully I'm inexperienced with both concepts.

Additionally, I am 'also' aware of the <noscript> tag, but we do not want to have the page be completely inaccessible and have to advise the user to "turn it on" or anything like that.

So, my question is this: is it a stupid idea to redirect to an entirely separate website if the browser detects JS is disabled (if that is even possible?) What about a page?

I ask because our current website is roughly ~15 years old and is pure html and css. We're in the process of re-branding and are wanting to update to a completely new look, but from what I'm seeing most of the mobile responsiveness capabilities require JS (not to mention nice looking drop-downs, sticky menus, etc).

Does anyone have any working experience with what I have to accomplish? What would be the best way to tackle something like this as one of the requirements is that the new website 'must' be responsive.

Thanks!

Upvotes: 0

Views: 485

Answers (3)

Dryden Long
Dryden Long

Reputation: 10190

As far as redirecting without JS is concerned, you can use the meta tag in your head to do that:

<noscript>
  <meta http-equiv="refresh" content="0; URL='http://example.com'" />
</noscript>

As to the rest of your questions, they can't really be answered here. It all depends on your site's dependency on JS and what alternatives you have available.

Upvotes: 2

Aramil Rey
Aramil Rey

Reputation: 3475

<noscript> //somecontent </noscript> Will show content ONLY to users without JS, redirecting is not a good idea, the vast majority of users has javascript enabled, and the ones who doesn't would probably like to know they doesn't, just let them know.

Still, you could do:

<noscript><meta http-equiv="refresh" content="0; URL='http://example.com'" /></noscript>

EDIT: Local redirect:

<meta http-equiv="refresh" content="0; URL='example.html'" />

Will lead to:

yourdomain.com/example.html

Upvotes: 1

Benjamin Williams
Benjamin Williams

Reputation: 193

I don't claim to be an expert in this field but I don't think I would recommend redirecting to another site purely because someone has disabled Javascript. Instead you could possibly put a little banner on the bottom of your site that is hidden if JS was enabled and would show if it were not.

Upvotes: 0

Related Questions