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
 
What I suggest is to make your site completely operable without JavaScript first, then add JavaScript to enhance the server-side code. That way, if the user does have JavaScript disabled they still have the server-side code to fall back on.

There is some server-side code that you definitely do not want to replace with JavaScript such as data validation scripts. Data validation should always happen on the server-side. Then you add JavaScript functionality on top of this to improve the user experience.

Adam
 
Hi

ice78991 said:
However, it means that my site is inoperable for users with javascript disabled.
And also means to make it inoperable for robots too.
ice78991 said:
It seems like a bad idea to reduce the quality of my site just because a minority of users may not have javascriipt enabled.
Sorry to say, but if your site's quality has to be given by JavaScript fanciness, then you have a serious problem. Better try to add valuable content.
ice78991 said:
I could include a splash screen to remind users to enable javascript if they wish to use the site.
But take care to not show that splash to all users, as splashes are in all tops of most annoying web design mistakes.

Feherke.
 
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 personally agree with you.

I'd use javascript on the site if I were you and still make it viewable and operable with javascript disabled. The only difference being less functionality on your page with it disabled.

Use the <noscript> tag and put a message up telling them that some features of your page are disabled because javascript is disabled in their browser.

With the <noscript> tag, only those (minority) that have javascript disabled would be bothered by a "splash" message.

I'm of the opinion (I know many won't agree with me) that since having javascript enabled is the default, users shouldn't complain that sites don't look/operate the same with javascript disabled. Most users don't even know how to disable javascript, it's not in a toggle button on the main menu.

[monkey][snake] <.
 
Hi

monksnake said:
since having javascript enabled is the default, users shouldn't complain that sites don't look/operate the same with javascript disabled
I agree. I will leave that site without even complaining.

You know, I have a habit to open many pages at once. And if I open one or two dozens of Tek-Tips threads in tabs, the scroller of the Whitepapers ( upper right on every page ) will spin up my processor. So while people are exaggerating with the JavaScript, sometimes I will keep it off.

Of course there are cases like Google Image Labeler, when JavaScript's services gives a nice experience. But in most cases they are somewhere between useless and irritating. Of course, this is my opinion.
monksnake said:
Most users don't even know how to disable javascript, it's not in a toggle button on the main menu.
Correct. For example neither I have the JavaScript toggle button on the main menu. It is on the status bar.

Feherke.
 
It is on the status bar.

In your developer tool bar, which you downloaded, right?

I agree. I will leave that site without even complaining.

You and the 3 other people in the world that have it disabled.





[monkey][snake] <.
 
Hi

monksnake said:
In your developer tool bar, which you downloaded, right?
No, you do not have to be web designer to be able to disable JavaScript with one click. It is QuickJava. But it could be NoScript too. By the way, disabling JavaScript with Web Developer is not one click. Is two.
monksnake said:
Feherke said:
I will leave that site without even complaining.
You and the 3 other people in the world that have it disabled.
Maybe. But beside 3 people probably 3 robots too : Googlebot, Yahoo! Slurp, msnbot.

Feherke.
 

To the detail:

Would you say then that linking with
<div onclick="document.location.href='http.......
should always be avoided ?
 
Well I am heavily into AJAX, I'd like to see any of the experts here write an AJAX application without using JavaScript!

If people have JS turned off, that's up to them, if they expect me to write my site to cater for them, well they can just visit someone elses site, sorry!

Do all you who have JavaScript turned off also have a black and white telly, a brick for a mobile phone and play games on a ZX81?

My site REQUIRES JavaScript, and if you don't want to turn JS on , then that's up to you, my site won't work properly so it's your loss not mine! (It works fine for me!)

At least JS is more compatible that Java or Flash, you need plugins for those yet JS is browser native!

Yet if people didn't use , like or want flashy sites with the latest technology, BeatPort wouldn't have made so much money and be one of the largest independent MP3 download sites, it would be a site that no-one visited because you needed a flash plugin to view it.

The truth is more like 99% of people have visited these flashy, funky sites and enjoyed them immensely and only those 3 people with JS switched off, are still sitting in the dark, wondering what everyone is so excited about!



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
1DMF said:
I'd like to see any of the experts here write an AJAX application without using JavaScript!
Since the J in AJAX stands for Javascript, I'd tend to agree! But I don't think anyone was claiming that they could write an AJAX application without any Javascript.

1DMF said:
If people have JS turned off, that's up to them, if they expect me to write my site to cater for them, well they can just visit someone elses site, sorry!
That is your preference. But for some people, who want to maximise their site traffic and give everyone some kind of positive user experience, ensuring Javascript degrades gracefully is important. However said that, it does all depend on what you're trying to achieve, who your target audience is etc.

Personally, I wouldn't like a site I had designed to blow up just because someone has JS disabled - it wouldn't create a great impression to prospective clients. I would tend to take Adam's approach of making the site operable without JS, then adding JS to enhance the user 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
 
I hear what your saying, and as you said it depends on what your trying to acheive.

I do have sites that work without JS, but I also have sites that require JS or just won't work.

The ones that require JS or else, are my own personal sites or I am using JS to acheive a specific goal my employer has asked for.

however I would have to say that most sites these days require at least JS enabled if not Flash or Java and currently I leave any site that requires Java or Flash, purely because they are not compatible with my OS , but JS still works!

personally I believe JS is the lesser of the 3 evils, technology has moved on enabling us to do some of the tasks client side instead of constantly putting the load on the server, that's a good thing isn't it?

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

1DMF said:
only those 3 people with JS switched off, are still sitting in the dark, wondering what everyone is so excited about!
Please note that certainly there are more than 3 blind people who navigate on the web. And if your site does not work without JavaScript then certainly does not work neither with screen readers.

I already know your answer.

Feherke.
 
does a reliance on javascript lock out your potential audience

The stats on my web sites over the years have shown that the drop in traffic is very small. But what will kill traffic is if the JavaScript doesn’t work. You should test your site with all the main browsers. JavaScript in FireFox rarely works in IE or Opera or even previous versions of FireFox. The situation is worse for JavaScript than it is for CSS.

You should also ensure that there is a way to navigate your site without JavaScript otherwise GoogleBot and the like won't index your site. But if most your site is behind a login box anyway (Like GMail for example) this is less of an issue.

 
Hi

Aptitude said:
JavaScript in FireFox rarely works in IE or Opera or even previous versions of FireFox. The situation is worse for JavaScript than it is for CSS.
I am wondering to what kind of code do you think. While both FireFox ( and other Mozilla-based browsers ) and Opera are standard compliant, both can execute the same JavaScript code. Even more, both build a secondary DOM tree with Explorer-like structure, so both are mostly able to execute Explorer-only JavaScript code too.

Could you please give us example of code with the problem you described above ?

Feherke.
 
I'm thinking of the different results you get from pageX and pageY properties in the mouse events.

On FireFox browsers you can attach to an event using addEventListener on IE you use attachEvent instead. On Opera both work. You can register events usin object.event = eventHandler, but this only lets you register 1 handler per event.

You have to do something like strange just to get the event object correctly as some browsers pass in the event object and some expect you to get it from the window object.
Code:
function doSomething(e) {
	if (!e) var e = window.event;
	// Do some stuff with e
}
 
Explorer does not follow standards

I think this is actually a case of the early standards not commiting to how these things should work. Microsoft did their own thing, Netscape did something else, FireFox (which came after the standards were updated) said forget backwards compatibility and stuck to the standards and Opera tried to do it all ways.

But anyway who cares, the fact of the matter is that the two main browsers don't work the same way which makes life a pain.
 
I'd agree with Aptitude on the most part. Though yes some JS won't work in FF and only IE.

This is probably because of the way the JS is written, be it non-standards compliant or browser specific quirks.

In I.E. I like the way you can talk to a form element with document.formname.element.value , though I now code everything with var obj = document.getElementyId('formID'), then obj.element.value etc...

as i've found all three main browsers work that way, still in ignorance to whether that is standards compliant or not.

I remember asking this question before in another thread and was told there were no "Standards" persae. Not like there is a W3C for X/HTML, CSS & RSS.

Would be nice if there was, or is there and can someone enlighten me please :)


"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