Search code examples
javascripthtmllayoutsemanticssemantic-web

Using JavaScript for basic HTML layout


I've been doing HTML layout as well as programming for many years and I'm seeing a growing issue recently. Folks who primarily do HTML layout are becoming increasingly more comfortable using JavaScript to solve basic page layout problems. Rather than consider what HTML is capable of doing (to hit their target browsers), they're slapping on bloated JS frameworks that "fix" fairly basic problems.

Let's get this out of the way right here: I find this practice annoying and often inconsiderate of those with special accessibility needs.

Unfortunately, when you try to tell these folks that what they're doing isn't semantic, ideal, or possibly even a good idea, they always counter with the same old arguments: "JavaScript has a market saturation of 98%, we don't care about the other 2%." or "Who doesn't have JavaScript enabled these days?" or simply "We don't care about those users." I find that remarkably short-sighted.

I would like the opinion of the community at large. What do you think, am I holding too fast to a dying ideal? Is JavaScript's prevalence a good excuse to use a programmatic language to do basic layout, thus mucking up your behavior and layout? jQuery and similar "behavior" based frameworks are blurring the lines, especially for those who don't realize the difference.

Most importantly, I would like some "argument ammo" to use against these folks when the "it's the right way to do it" argument is unacceptable. Can you cite sources outlining your stance, please?

Thanks everybody, please be civil :)


Solution

  • I consider myself also "old-school" and intend to use javascript in a way that increases user experience, but it is not necessary. So for example (not layout, just easier to understand) i would alert you with js if you haven't filled a required field in the form, but if you have js turned off I'd still "catch" you on the server side.

    And yes, wherever I can I try to use static html+css. A good example is: many people use jquery animations, but in some circumstances it is easier / faster / smoother to use css transitions.