Using Javascript to aid layouts
With the increasing popularity of libraries like jQuery that make Javascript a lot more friendly, I see a tendency to delegate parts of the layouts to the client side: things like coloring of table rows (from simple things up to tools like flexigrid), fixes for cross browser CSS incompatibilities, syntax highlighting and so on.
Is it now an acceptable pract开发者_如何转开发ice to assume users will have javascript enabled and use the extreme convenience of these libraries or should layouts always be done via markup and style sheets with javascript just for sugar and/or when really necessary?
It probably depends on the audience -- if you're dealing with a computer security website, I'd assume more people would have javascript turned off.
If you can, stick with progressive enhancement where possible, and try to make sure the site's at least usable without javascript turned off.
If you're not sure -- then set up some logging. A little javascript to adjust any internal links clicked to add something to the query string can tell you pretty quickly how many people have javascript turned on.
精彩评论