Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is Javascript good for your site ? 9

Status
Not open for further replies.

ice78991

Programmer
Nov 20, 2006
216
I've been wrestling with the question of whether to use javascript in my site.Assuming that a certain number of users have javascript disabled, does a reliance on javascript lock out your potential audience?

I would like to implement my navigation code in javascript because it makes my code much smarter. However, it means that my site is inoperable for users with javascript disabled. I have concluded however that I should make my site as neat and efficient as possible and if this means using javascript then so be it. It seems like a bad idea to reduce the quality of my site just because a minority of users may not have javascriipt enabled. I could include a splash screen to remind users to enable javascript if they wish to use the site.

Any comments on this would be appreciated
 
Cool, added to favourites, let's hope I get a chance to read it!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Quite simply, unless I have a VERY impelling reason to enable Javascript for a specific site, I will simply ignore any site that imposes such a requirement. Exactly the same with those sites that seem to consist of Flash or whatever nonsense and show nothing without it - good for them, I will never visit them a second time.

Additionally this nonsense about there being just 3 people not opening their machines up to the vulnerabilities of enabling Javascript - virtually all the computer literate people I know keep Javascript DISabled on their main machines, with possibly a secondary machine (where the consequences of Javascript abuse are not important) having it ENabled.

In general, I will try a site ONCE - if I can't use it, I will never visit it again.

[vampire][bat]
 
virtually all the computer literate people I know keep Javascript DISabled on their main machines

Isn't that about 3 people?

The majority of web surfers are not computer literate people, the computer literate people usually know exactly where they are going and what they are going to do.

[monkey][snake] <.
 
I may be completely unaware, but I've never seen any javascript code that is harmful to a user's machine that didn't require you to click "ok" to run an activex script first.

Virtually all the computer literate people I know are smart enough to not blindly click "ok" to run activex scripts from unknown sources. That said, I don't see any reason to DISable javascript other than to prevent annoying scripts from running (like the whitepapers add on this page). However, annoying scripts can hardly be classified as javascript abuse.

That said, to always leave Javascript disabled to be "safe" just seems downright silly to me. With ajax pushing forward into the mainstream, and web applications becoming more and more popular, why would you want to ruin your web experience? Not installing flash - I can understand that. But, javascript comes built into almost every browser because it is widely accepted, and reliably safe.

I understand and embrace the fact that javascript should not be used for navigation and other things that a browser can inherently do by itself, but come on.... leaving it ALWAYS disabled? That seems to me to be teetering on the edge of paranoia......

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Infact, just to be really sure you're protected, why not just turn your computer off and go ride your bike or something!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Hear, hear Kaht! I think that's a sensible balance.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
>not opening their machines up to the vulnerabilities of enabling Javascript

You must be thinking of VBScript and if they're that smart they'd be using FireFox and VBScript wouldn't be an issue.

>why not just turn your computer off and go ride your bike or something!

you could get hit by a car, best just sit in a padded cell.


:)
 
1DMF, MarkZK how sad that you both think that I can not use a computer UNLESS I am connected to the internet.

kaht, what you say makes sense, however my machines have never (touch wood) suffered any ill effects from my preferred course of action, and yet, prior to taking this stance and despite being as careful as possible I managed to acquire the services of a keylogger. As such, if I can't view a site, I can't view a site. If I really do need access to a site, then as I said I do allow Javascript - TT being the exception (I don't really need TT but I do allow Javascript).


[vampire][bat]
 
love it MarkZK, my sides are still hurting!


[rofl]


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Just... wow.

I find it quite worrying that professional web developers can't see why you should not place reliace on Javascript or any other supplementary technology when building a web site.

Have you never heard of Progressive Enhancement?

This thread started out with some sensible suggestions that you should build the site to work without JS and then enhance it with Javascript.

Have you considered the legal ramifications here?
If you build a site that is unusable by a person without Javascript you are basically breaking the law. You can be called out since you could be seen as discriminating. Might sound dumb, but consider this scenario: -

You are an architect tasked with designing a new public building. Do you require access to the building via a flight of steps or would you design it either without the steps or offer an alternative means of access?

It's just the same with Javascript - even when using AJAX.
Your site should function without the javascript or AJAX. The benefits that can be afforded through the use of these technologies should then be added on.

For example. Let's consider a simple email contact form.
Your form action should be to the server side processing script. This means the thing will work regardless of having JS or not.
You can then attach a JS event handler to this in order to fire off an AJAX call - to submit the form, get a response and update part of the page accordingly.
This is how it should be done. Plain and simple.

As professional web developers and designers it is our responsibility to do things right both for our clients and their customers. If we neglect this responsibility then, quite frankly, we are just dabbling.

There is no doubt whatsoever that using Javascript and associated practices such as AJAX can greatly enhance user experience. Did you spot the key word there? Enhance.
Sure, if you are building a niche site for a closed audience then you may be able to get away with some things, but lets face it - we generally build sites for the public.

Personally, I don't disable Javascript unless I'm testing something. But I do test what I am building to make sure it's going to work without JS. The question of whether people have JS turned on or off is moot. As was stated the majority of people neither know nor care about Javascript. In my mind, that's all the more reason to make their experience as transparent as possible in all circumstances. We do the work so they don't need to wonder why the site doesn't work all of a sudden.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
You need to put that into context Foamy!

I do not have to write a website accesible by anyone it's my website and if i don't want you to view it, it's my perogative!

my personal sites do not have to meet any standards, disability , accesability or anything else.

That said , if you are writing a website for a specific purpose, and it does not meet the specifications / purpose that is different.

It's obsured to think i'm breaking a law if I use javascript, are you saying all sites that use Java, Flash, VB, .NET , etc.. all break the law because you have to have a plugin or certian framework / platform to view the site.

Not all browser are CSS compatible, should we all start using the <font> tag again otherwise we are breaking the law?

Foamy, are you a member of the gestapo or something?


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
my personal sites do not have to meet any standards, disability , accesability or anything else.

That said , if you are writing a website for a specific purpose, and it does not meet the specifications / purpose that is different.


If you are providing any kind of service then you must every effort to make that service available to all.

That's the law in UK mate. Like it or not. If some (probably vindictive) user wanted to call you out on it, they could. Simple fact.

It's obsured to think i'm breaking a law if I use javascript, are you saying all sites that use Java, Flash, VB, .NET , etc.. all break the law because you have to have a plugin or certian framework / platform to view the site.

No, I'm not saying that. You need to look at the context.
What I am saying is that you are breaking the law if you require the use of something and don't offer an alternative. By building a service that needs the user to have Javascript in order to fulfil the purpose of the site you effectively remove access for many users.

I would guess that one could argue that so long as the technology is freely available to that user should they wish to use it then you will be OK. But if the technology is, for whatever reason, not freely available then you are discriminating.

You should never build a site that needs anything other than a user agent and internet connection to be at least minimally usable.

Nobody is suggesting you mustn't ever use Javascript but you should allow for someone being able to use the site without it. Whether they get the same user experience or not, you should allow for it. The simplest form might be that you offer the same service in a different manner, for instance via telephone (with the accessibility issues that also entails).

How is CSS essential to a site functioning?
If you remove the CSS from a site, it just looks different.
CSS is a great example of Progressive Enhancement.



<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Foamcow, you are obviously a professional and whether or not you agree with my stance, you provide for it.

My feeling is that I should be free to browse a site - if I want to buy something or need to input data to enter a reserved area or whatever, I appreciate that code has to be executed to support that functionality and have no problem with that. It then becomes my decision whether or not to proceed.

1DMF I can't find perogative, or obsured in the dictionary - are they web programming terms? Could you explain them, please?

[vampire][bat]
 
My feeling is that I should be free to browse a site - if I want to buy something or need to input data to enter a reserved area or whatever, I appreciate that code has to be executed to support that functionality and have no problem with that. It then becomes my decision whether or not to proceed.

Yes.
But bear in mind also that alot of those 'extra' things can be (and possibly should be) done server side. Doing things server side outs technology requirements and responsibility squarely in the site owner's camp.
IMHO Javascript, Flash or whatever should be used for client side interface enhancement and not for providing a sole means of core functionality.

Perhaps someone can suggest an example of some core task that could only be done with Javascript?

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
In general I'd say adam0101 covered this days ago (hence me giving him a star and not commenting on the OPs question).

As for making a site that is reliant on Javascript, that (like many things) in my opinion would come down to money, if it is a government site and the taxpayers are footing the bill, then I'd agree with Foamcow, (they "should" also be accessible websites) but, if it's the individual paying for the domain/hosting/broadband then that individual has the right to use whichever format/script they like, just as you'd have the right to never revisit the site.

>how sad that you both think that I can not use a computer UNLESS I am connected to the internet.

I don't recall telling you you couldn't, that said, considering this is the Javascript forum, which is a web browser script and correct me if I'm wrong, but web browsers are regarded as internet based tools.
Maybe you mean something else by this random comment, feel free to explain. :)
 
I would like to see someone try to implement a Google Docs clone without JavaScript.

It's called "Microsoft Word" and "Microsoft Excel".

I think that when Foamcow said "core task", he was not referring to a JavaScript application, but rather something a web site might need to have.

Yes - Google Docs is technically a web site, but it's not what I would call "core functionality" of a web site.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Aptitude said:
I would like to see someone try to implement a Google Docs clone without JavaScript.
The core task that Google Docs offers is that of word-processing/spreadsheets which could certainly be achieved using server-side code. Granted, it wouldn't be as smooth as the Google Docs interface, but the core task could easily be delivered and I think that's the point Foamcow is making. The core functionality is delivered by the server-side code whilst AJAX/JS provides the enriched/enhanced user interface experience.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
earthandfire - I can't find perogative, or obsured in the dictionary - are they web programming terms? Could you explain them, please?

haven't you guessed , i'm illiterate?

What I am saying is that you are breaking the law if you require the use of something and don't offer an alternative.

So the fact that JS enabled browsers are freely available to everyone, means using JS is no problem.

If you go buy bricks, it's not the merchants job to supply you free cement/sand/trowel in which to lay them.

and if someone isn't prepared to use the right tools for the job, it's no-one elses fault but their own, if things don't go to plan or work properly!

out of curiosity, is the .NET framework available for non windows platforms?

or VBScripting in non IE browsers?





"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top