开发者

Does it make any sense to write sites which works without javascript? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center 开发者_开发问答for guidance. Closed 11 years ago.

Site markup is targeted to HTML5. So it's assumed to be runned in modern browsers. Does it make any sense to support javascript disabled scenarios?

If it does, how flexible it should be? Should it allow users to do all or just basic things?

And the same question for CSS. Should I use some patterns (e.g. tables instead of divs and so on) to support clients with disabled CSS?

P.S. I don't have any specific requirements, so it's like a personal challenge.


Its up to you on supporting no javascript. Why don't you ask yourself these questions first?

  • Do I want my site to be used by blind people (who often use browsers which don't play well with javascript)?
  • Is this for a federal/gov't agency? (Often, gov't agencies REQUIRE this in order to accommodate people from the first item)
  • Do I want to accommodate all of the security nuts (no insult intended) and people who turn javascript off to avoid annoying ads?

You should ask yourself these questions first. I'm not trying to suggest you don't like blind people or you're lazy. I know, that if you already have a site which doesn't support javascript turned off, this is going to be a nightmare. So I'm not trying to fling insults/guilt trips. But if you're starting from scratch, then IMHO, it is a good idea to build it without javascript, and then go back and add it in later.

As far as CSS being disabled, I think you're ok not worrying about that one.

As far as divs vs tables. Go with divs, and use tables if you're rendering tabular data. Basically, if you're trying to make something render in a certain place, and you're trying to use a table, you're doing it wrong (you can google about it if you're that interested).


If you follow standards, which includes seperating style from content from funcitonality, then you don't have to know the context that someone is experiencing your website - but you can be confident that they are getting it in the manner they are accustomed to.

For example, there has been a robotic hand developed that can both read and write (sign) in manual sign language, which is touch based (for people who can not see or hear - so no screen, no screen reader). If you have made your website to follow standards, it will be easily accessible by this technology - and also other scenarios you might not have considdered.

I think that corporate firewalls and public computers have javascript disabled more often than you would think.

Also, there is an added benefit to simple html, with appropriate markup to define what elements are, in that search engines can correctly interpret your content and list your site accordingly.


Edit: afterthought

Another example of not following standards getting you into trouble, is adding javascript click events instead of allowing the normal browser action. This can cause problems on touch screen devices where the click event can fire twice (if you include touch event too) or not at all (because the touchscreen has no click event, and only sometimes tries to emulate click events badly)

The moral of the story is that if you follow standards, then you don't have to second guess all the possible scenarios that people could be getting your content, you just know it works.


Graceful degradation is needed when it comes to javascript. Users without javascript should be able to browse your site without issues. (Yet not getting the full experience they would with JS)

Disabled CSS? Tables? Madness. No. If you go down that road, you'll end up making websites for browsers that can't read HTML.


Note: When I said that about graceful degradation, I had in mind a site where Javascript is just a plus on the website. If you are making a site that mostly relies on javascript to do everything, don't bother. You shouldn't make a site in which the experience that the user get is TOO diferent from what you intended.


It all just depends on your target audience. Remember, HTML5 is supported in modern browsers and would be a problem with older browsers( there's libraries to help with this like modernizer ). You can use a technique called progressive enhancement if you're really worried about supporting all types of clients. Most browsers nowadays DO have javascript turned on. As far as CSS goes a table-less approach is recommended. Tables should only be used to represent tabular data. This makes styling the elements easier and is a more flexible approach.


JavaScript is still disabled by some for "security concerns". The question is: are these users being alienated without cause? Some "rich client" techniques simply require the client-side power of JavaScript. If it does, it does: if it doesn't, it doesn't. Know the target audience and provide a fall-back as required.

I have yet to meet anyone who has purposefully disabled CSS. However, it is important to keep in mind users with vision disabilities who might be on alternative readers where CSS does little or no good -- this includes CSS/JavaScript interactions such as "sliders". It might be worth looking into WAI-ARIA if this is the concern (but no tables, except for truly tabular data -- in which case, no divitus!).

Also, there might still be some people using Lynx -- new versions in 2011 ;-)

Happy web developing.


I don't think using table instead of divs it's a good approach.

When I think in javascript disabled two thinks come in my mind:

  1. Server validation if you have forms (important!)

  2. Alternative to ajax features (maybe, it depends of your site)

Clients with disabled CSS must be able to read your content, so write clean and meaningfull code. The site don't need to be equal with and without CSS enabled.


I would just like to tell you while designing website, don't ever trust your users, as you will never know what can happen at what click, so its better to adopt something strong which can validate all your content of website and user may turn on/off javascript. So your website should run in proper way without any interference.

And about Table, its not good to use table always while formating your data, so use instead DIV or SPAN as you will need to apply CSS for that also.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜