![]() |
Philosophizing about the use of JavaScript on a website
Quote:
The reason why it might well be better to do something server-side is not, in my opinion, anything to do with Javascript-disabled browsers. It is simply which method is most efficient and secure. In this situation you are right to say that server-side is to be preferred. But Javascript is much more than "bells and whistles" and these days is completely essential, not optional, for web functionality. As VIP Stephan has pointed out, the OP said "I didn't write this script and I'm not a JavaScript expert, so I don't know how to edit it properly. I want to change it's function from sorting to filtering, i.e. something along the lines of a slice function. " So there is no point in whickering on about your preference for server-side scripting. You might as well suggest that the OP writes it in Klingon. |
Quote:
|
Quote:
I guess with a 15.26% "thank you ratio" (338/2215) fwiw, I must be doing something right and I can't be all bad :) |
Quote:
|
Quote:
|
site that don't use javascript tent to suck pretty bad UX wise.
HTML form attribs and css animations help to some extent, but only scripts can do everything that html, css, and js can do. live search, suggestive form validation, form suggestions/deep auto-complete, enjoyable multi-image browsing, partial page refreshes, view state persistence, selection manipulation, 3rd-party api content, ARIA accessibility, and graceful video handling all require javascript. sure you can make page like it's 1999, and those pages will work, but people expect more. the bottom line is often budgetary: is it worth 50-100% more effort to support <1% of the market, or would your time be better spent making the "99s" version really awsome? |
I don't think anyone is disputing that javascript enables you to add functionality and other "pretty" bells and whistles to a website.
But when a function can be done both server and client side then I see no reason at all to waste time doing it client side, unless of course it's a requirement in the website specs, because of the need then for a plan B to perform that function in javascript disabled browsers. So when a function can be done both client side and server side, I will always do it server side first and then client side only if required. If a function can only be done client side, then obviously I will use javascript. |
Quote:
Quote:
Quote:
Quote:
Quote:
And if you have one million visitors on your site and 1% of them can’t use it because it’s unusable without JS that would be 10.000 people you lose. Imagine what difference 10.000 (missed) customers can make if you’re selling something. Imagine how many users Facebook is missing/losing because their site isn’t usable at least in a basic form. |
Quote:
So since you believe it is ok for you to repeat yourself I guess it is then ok for me to simply return the same reply as before. Quote:
|
@VIP Stephan - I have thought carefully about what you say, but I have to say that although I understand your argument and greatly respect your experience I prefer the opinion of rndme. "Live search, suggestive form validation, form suggestions/deep auto-complete, enjoyable multi-image browsing, partial page refreshes, view state persistence, selection manipulation, 3rd-party api content, ARIA accessibility, and graceful video handling all require javascript."
And you say "I don’t care how the site works as long as it works." Well, yes. I don't think you can dismiss sites which require Javascript as flawed. I prefer to say that the tiny minority who deliberately elect to disable Javascript in their browsers (why do they do that?) ought to accept and endure the consequences of that. Like rndme, I think that Quote:
This is as serious and important topic, so I would welcome the views of other senior and respected members of this forum (especially Javascript moderators and perhaps even WA) on this topic. |
@bullant - As you so often say, everyone is entitled to their opinion. :) Perhaps your problem is that I tell it you without soda - and will continue to do so - repeatedly. :)
|
Quote:
Quote:
And for a reason why people might actively disable JS in their browser: There are so many tracking scripts nowadays, so many cookie scripts, so many advertising scripts, so many other distraction that you can avoid if you browse the web without JS. Plus, it increases loading speed and saves bandwidth if there aren’t numerous widgets trying to connect to some third party site to download additional content. There are still people that don’t have the latest DSL at home. Quote:
|
As I say, I would welcome other considered views.
|
Quote:
Once upon i time, it was my express determination to support every visitor to the sites i built. I even went so far as to integrate a restful text-only (ascii, not css) view for the CMS i built for my last job. The point was for users in developing nations with miniscule bandwidth can read the info we published. Since one of the potential destination sites for the framework was the atlas of world hunger, this was a key consideration. Know your audience, ascii and lynx support is not always needed. When css first came out, a lot of well-respected "experts" advised to continue working with html3 tables, since not all browser supported CSS at the time. Eventually, developers became confident that 98%+ support was "enough" to remove unskinned views from the design iteration cycle. Another factor is cost. Despite some number thrown around about development, there are other costs associated with good javascript-less sites. Server-side scripting requires a host, which requires public registration, and usually credit-card payment for the plan. Those things are way out of reach for the meager among us. Scott McNealy said that "Half the world dies without making a phone call". Also, Lots of folks don't know server-side languages, and the penatly for back-end mistakes is MUCH higher than it is for annoying client-side script errors. Some people's hosting plans don't have server support; many hosted CMSs don't allow regular schmucks the ability to execute, other than pre-designed plugins. So, the only way for those folks to make a highly usable site is with javascript. Don't assume we can all run php. I actually agree with the Luddites here that there is little point to having javascript on a brochure-like informational site, other than for the bells and whistles i previously alluded to. But, pages aren't always documents anymore; increasingly they are apps. If you just build brochures, stick with document-central languages like html and css. But, if you are like the increasing number of developers creating HTML5 applications, i don't see a static fallback as possible or frankly, even desirable. Imagine google docs or maps without javascript... i don't think that VIPStephan is "wrong" about javascript reliance; the old way is undoubtedly 1% more reliable than the new for reaching users. It's a battlefield-tested way of getting content to the seething masses. But, if you want to travel beyond the document and into app land, you won't get very far without client processing, be it javascript, flash, or something else. |
I'm personally of the same opinion as Stephan. Adding functionality via JS is fine, but at least make sure the core system works without. If someone wishes to browse either with it without it enabled, they should be able to view the content and use the site regardless, in some way or form. Take this braindead site as an example:
http://safeweb.norton.com/ Give me one good reason why they do the redirect for non JS enabled browsers. It's a search on the landing page. Just about the simplest thing you can expect to do on an interactive page, yet they refuse point blank to allow non-JS clients. Why? As to why browse with JS disabled... Try using an old machine and browsing the web sometime. It's really amusing to have a machine practically stall on you because of all of the superfluous and totally unnecessary effects and other JS gubbins which one likely has no interest in. What about malicious JS code on hacked pages/sites? Plenty of reasons to browse without JS generally, IMHO. If JS is available, then by all means use the extra functionality. But please, just don't penalise those who browse without. There's neither reason nor excuse for doing so, other than saving oneself some minimal extra effort. |
| All times are GMT +1. The time now is 07:13 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.