Is it safe to assume that Javascript is always enabled?

Duplicate:

Do websites need to serve browsers that don't have Javascript? Only support for users with Javascript enabled.
How common is it for Javascript to disable
How many people disable Javascript?

I have been doing web applications for several years and every application I write seems to have more javascript than the last one.

Frequent comment: "But what if the user turns off Javascript?"

I understand, but I've never seen a user do this. More than once.

Do you have?

+1


a source to share


12 replies


This happens after about a week or so. Did you search first?

See:
https://stackoverflow.com/questions/121108/how-many-people-disable-javascript
https://stackoverflow.com/questions/379735/how-common-is-it-for-javascript-to-be -disabled
Only support for users with Javascript enabled
Do websites need to serve browsers that do not have Javascript?

Highlights:



  • Google does not use javascript when indexing
  • Mobile browsers (smartphones like iPhones) sometimes have bad or nonexistent javascript
  • Screen readers don't do javascript well, if at all, and many developers are legally required to support them.
  • Thanks to filters like NoScript, the number of people viewing with javascript disabled (at least initially) can really increase.

So yes, you still need to worry about it.

+8


a source


It all depends on what type of coverage you need.

Do you need 80% 90% 100% of users to be able to use your site / application?



People turn off Javascript. The question is, should your site work for these people? Can you just tell them to turn it on if they want to continue?

+7


a source


Yes it does.

NoScript is a Firefox add-on downloaded by a lot of people.

No Script

+3


a source


You should always make sure your site works without javascript.

People have disabled javascript for security reasons. Sometimes companies have to disable javascript on their computers. Also spiders don't have javascript, so your site doesn't work without javascript - this is bad SEO practice.

+2


a source


+2


a source


It has become a standard in my office (for better or worse) to assume that the user has installed JS and enabled it. The number of people who have disabled it is getting smaller and smaller every day, but that still doesn't mean that you should give up doing the necessary validation to send on the server side, just in case (as well as some other scenarios).

+2


a source


I would say that it is unsafe to assume that javascript is always enabled, but it is safe to enable JavaScript.

In other words, you don't have to jump through hoops to get something to work without it, just display a message or redirect.

Javascript is an important technology and it is unwise to require it.

+2


a source


This is rare, but possible. If you are launching an application for "everyone" for use on the Internet, then yes, you will have to prepare for such an event. It really depends on your target audience, but the safest assumption is that someone will disable it.

From a security perspective, you definitely need to deal with this situation, as disabling JavaScript (or worse, hijacking scripts you write) can easily bypass business logic and validation unless it's double checked on the server.The requirement to be enabled is not good enough protection to stop people in this situation. Remember that you are asking the browser to inform you that it is enabled and disabled. The user (or attacker in this case) is in control of the browser and you cannot trust what he says as it is easy to change the HTTP headers.

+2


a source


Depending on who your target audience is. Some users have disabled JS for various reasons. Usually they will allow it for individual sites that need it, but they may not do it unless you tell them they need it.

If your site just doesn't load correctly, it will consider it broken. If it shows the message "you need JS to view this page", then at least they will know what to do.

Some of them will include Javascript for your site, but some will not, and they simply won't be able to use your site unless it works without Javascript.

+2


a source


This is rare, but it happens. It really depends on who your user base is. If it's for corporate users, many of them have default security settings with javascript disabled. If it's for ... pretty much anyone else, chances are it will be included.

+1


a source


I am running by default with javascript off for new sites (NoScript). I think a lot of technology-minded users are doing the same. At least those who are paranoid about XSS attacks.

0


a source


It's best to use code for users who have JavaScript disabled.

As a web developer, your goal should be to provide basic core functionality (no JavaScript). This allows all users to fully experience your site. Then, using JavaScript, in a process known as "progressive enhancement", create site elements for users who have JavaScript enabled.

And in case JavaScript is disabled ... your site should degrade gracefully.

Web development is one of those areas where you can't expect anything. Code for all users to maximize your site's availability.

0


a source







All Articles