开发者

Javascript penetration

Working on developing a web application, and there needs to be some graceful fallback for 开发者_如何学Gobrowsers without javascript. However are there were any statistics around how many people (real people, not indexing robots) run their browsers without javascript on (or use a browser with no javascript).


http://www.w3schools.com/browsers/browsers_stats.asp is one such set of stats. I don't think there is any one place you can get a definitive number. It's a constantly moving target anyway, but this set of stats is as good as any.

scroll down a bit to see javascript support.

A good portion of my answer was deleted because, well, it was dumb.


As David Lively commented, search for "unobtrusive javascript" as well as "progressive enhancement". Ignore the old "graceful degradation" articles.

If you start by making a fancy "web 2.0" page then try to gracefully fall back if there's no javascript you'll have a much harder time than if you start with a plain page that works for everyone and then enhance it by using javascript when it's available.

It can be done (it's true, I swear, I've done it) regardless of what some people think. It's more than zero effort but it's not doing everything twice.

An example from my work is a group membership page. People available are listed on the left, current group members on the right. There's a checkbox next to each name and buttons for "Add To Group" and "Remove From Group". You can check as many boxes as you want and add or remove group members. This works as a plain HTML form with no javascript required, however when the javascript runs all the checkboxes and the two buttons are removed, and the two lists become draggable and droppable. You can move people in and out of the group easily just by dragging them around and hit the single "Save" button when finished.

My point being, and as a roundabout answer to your question, you shouldn't care what kind of penetration javascript has in the (your) market.

There will always be some people that disable javascript until they decide they trust your site. These are often some of the most technically savvy people and you may not want to exclude them from your market/audience.

People using screen readers or braille terminals also (still) don't have javascript support although the day may come when they do. In the mean time, do you want to exclude that population from your application? In my case, I'm mandated by the Americans with Disabilities Act (ADA) to support them (I would anyway) and not doing so can lead to discrimination lawsuits. kekekela's "its a waste of time now" is simply not an acceptable answer for me.


I would create hidden variable with a value of zero, and a piece of Javascript that sets a that field to 1. If the page has a form, the variable would be sent back and counted. If the page doesn't have a form, you could use some AJAX to send back the variable. On your server you could compare the number of pages requested versus the number of 1's that you received for a page.

If your users don't have javascript enabled, forms would return that hidden variable as zero, and pages without forms would not return the variable at all. Still, you would increment the number of views for that page.

If your user do have js enabled, you would increment both the number of views and the number of viewers with javascript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜