Originally posted by missingno:
I would differentiate between "using JS" and "relying on JS". You should never rely on JS, but you might use it for some parts. For example, if you have to sort an array to display it in your frontend, I wouldn't mind if the client manipulates the result as that only affects his side. But if you store the array back on the server side and "rely" on the data in it, I would have to validate anyways. So in this case, it doesn't make sense to do the sorting on the client side, but rather do everything on the server side and only send the results (which the client may manipulate, but I don't care as the server is still consistent).
Amazing how you miss the point altogether.
You are still in the era of using _area- -/area_ tags:
The server sends an image-area and a JavaScript form.
{subsection A}
The user clicks on several check/radio buttons on the form, and types in data in input fields.
The user hits submit button.
The server validates the data.
The server processes the data and sends a new modified image-area, along with the entire page, most of which has nothing to to with this image-area.
--repeat subsection A --several times-- (overworking an already overloaded server) until the user is satisfied with the state of the image.
Now the user clicks on the image-area (it is a color picker).
The data of the user-click is sent to the server, processed into a hex-color, rgb color, etc. in a computationally intense process, again overworking the server (unnecessarily, because __we can't rely on JavaScript__), and the entire web page is resent, but with another form field filled in with the user-selected color from the image-area.
And we still haven't even mentioned that somehow this process has to keep track of WHICH color-selection-input is getting filled. Remember, we cannot rely on js!
Now the user does all this over and over again, waiting patiently for the server all along..... In fact, every "live" action like this needed must be sent to the server for processing.
After half-an-hour of back-and-forth data transfer, the user finally has a complex web-form filled out (with many fields being being the selected colors mentioned above). The form is dynamic to properly represent all the needed data, so every time the form needs new fields added or fields removed, a special submit button must be pressed by the user, and the server will add or remove the proper (new or old) fields, and send the page back to the server, keeping track of every POSTed variable to properly set the form inputs to the previous user-selections.
The user finally submits the fully completed form with another separate submit button (the form has 100 or so throughout that do various different things - a real swamp of an _application_ if you can really call it that)
The server validates and processes the data, refills the form with the POSTed data, and sends a new web page including a new graphical-image (besides the color-picker image mentioned above) developed from the user-sent data.
The entire process repeats until the user is finished, an hour later.
Or we could _rely_ on JavaScript. All this could be done on the user's machine without pestering the server. In fact, we don't even need the server, a static HTML page can reside on the user's harddrive and used anywhere, anytime. We can save the final image to hard drive, or perhaps send it to a server, fully processed.
Relying on JavaScript to do the job, the user is done in 10 minutes, and the server is free to serve pages not process sub-data for every little user-interaction.
We USE JavaScript to _enhance_ the user's browsing experience on a public server-sent __web-page__ that MUST work for every poor user with a computer from the year 2000 with MSIE6 and/or JavaScript turned off. HTML5 desktop apps _rely_ on JS.
Any time an __app__ needs to do some work, the server should be minimally involved, if at all.