11

are there any web browsers that do not support javascript? and how to identify if client is using one of those browsers? or client has disabled javascript?

asked Jun 18, 2011 at 19:40

4 Answers 4

14

are there any web browsers that do not support javascript?

Of course. Lynx is just one example.

and how to identify if client is using one of those browsers?

Using the <noscript> tag to provide alternate content.

or client has disabled javascript?

Same answer as previous : using the <noscript> tag.

You should never test if a client is using X or Y browser. Always perform feature detection. Step one: use <noscript> for providing alternate content to clients that do not support javascript. Then test whether the client supports the feature you would like to use. Never test if IE8 or FF3 or something else, ...

Modernizr is an excellent framework which could aid you with this. So if you want to use some of the new cool HTML5 features, don't test if the browser is such and such version: test if the browser supports the feature you would like to use.

answered Jun 18, 2011 at 19:43
Sign up to request clarification or add additional context in comments.

Comments

3

As if you will working with CSS :

Many adding no-js class in <html> tag like..

<html class="no-js">

and they do replace no-js to js by javascript later, like..

<script>
 document.documentElement.className = document.documentElement.className.replace('no-js','js');
</script>

So when client has disabled javascript.

Example use :

HTML :

<div class="test">This box with some JS function</div>

CSS :

.no-js .test {display:none;}

Hide this box, when client has disabled javascript.

or..

HTML :

<div class="alert">Please, turn you JS on!</div>

CSS :

.js .alert {display:none;}

Hide alert box when JS is on. But still show when JS if off..

Or do something many more... with no-js or js classes..

If your looking for HTML tag for detection :

just <noscript></noscript>as another say

answered Sep 15, 2014 at 8:58

Comments

1

All of the modern major browsers support JavaScript. There are however some that do not, but with an incredibly small user base relative to the main ones. Some users may disable JavaScript, in which case you can specify different content for those users using noscript tags.

answered Jun 18, 2011 at 19:43

Comments

1

Do you use any javascript framework ? (jquery, prototype...) They can abstract a big part of browser specificities.

To detect user browser, you can use the navigator object : http://www.javascriptkit.com/javatutors/navigator.shtml

And, as James and Darin pointed out, you can use the <noscript> tag for alternate content.

answered Jun 18, 2011 at 19:46

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.