Using Javascript to Render Data

This message will probably be needed for some changes. I'll do my best to explain ...

Basically, as a tester, I've noticed that sometimes programmers who use templated web ends put a lot of stuff on onload handlers, which then do things like load menu items, change displayed values ​​in forms, etc.

For example, a page displaying your network configuration loads blank (or dummy values) for IP information and then loads a block of variables into the onload function, which sets the values ​​when the page is rendered.

My experience (and gut feeling) is that this is really bad practice for several reasons.

1- If the page is rendered in an environment where Javascript is disabled (for example, when using "Submit Page"), the page will not render properly in that environment.

2- The HTML page becomes very difficult to diagnose because what is actually on the screen needs to be put together by running javascript in your head (this issue is less visible from Firefox because of Firebug).

3- In most cases this is not done using standard environment function practice. In other words, there is no service on the back-end server, the back-end code looks the same as spaghetti in the final HTML.

and not really a reason, more a correlation:

I noticed that most of the coders who do this tend to be codons with a lot of code-related bugs or critical integration bugs.

So, I'm not saying that we shouldn't use javascript, I think what I'm saying is that when you create a page dynamically, the dynamic behavior should be isolated from the external server and you should avoid changing the displayed information after the page has loaded and rendered.

0


source to share


2 answers


I think what you are saying is what we should be doing is Progressive Enhancement with JavaScript .



Also related: Progressive Enhancement with CSS , Understanding Progressive Enhancement, and Progressive Enhancement with Validation .

+1


source


So the actual question is "What are the advantages / disadvantages" of generating javascript content?



here's one: a lot of things that designers want are difficult in straight html / css or not fully supported. using Jquery to create zebra tables with ": odd" eg. Sometimes the server infrastructure doesn't have good ways to achieve this, so the way to get the cleanest code is to split it up like this.

0


source







All Articles