Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using JavaScript for basic HTML layout [closed]

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 :)

like image 612
Slobaum Avatar asked Apr 11 '12 21:04

Slobaum


People also ask

How does JavaScript interact with HTML?

javascript is embedded into html with script tags. if you open a raw javascript file the browser won't execute it, it will just show the code. it's the same as importing resources to a java project.

What are three types of layouts HTML?

CSS layout types: Fixed, Elastic, and Fluid.

What is the basic HTML layout?

An HTML layout is a blueprint used to arrange web pages in a well-defined manner. It is easy to navigate, simple to understand and uses HTML tags to customize web design elements. Crucial for any website, an HTML layout that uses the correct format will easily improve a website's appearance.


2 Answers

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.

like image 143
Gavriel Avatar answered Sep 28 '22 12:09

Gavriel


I agree with you, but because of the 2% but because of the inconsistent page load. As soon as you use client side functions to change the layout you have a short delay between the fully loaded page and the whole functionality. I usually try to do as much as possible with html/css.

like image 20
Philipp Avatar answered Sep 28 '22 12:09

Philipp