Jump to content

To Javascript or not


aztec

Recommended Posts

Hello

 

The question that I am asking maybe has different answers for different people, but I am sure that your knowledge is greater than mine so here goes.

 

Many people tell me that they turn off Javascript in their browsers. They have there own reasons for doing this and there is little that can be done about it, except to educate them.

 

Is there an alternative language to Javascript that cannot be turned off but can create the same experience for the user?

 

I know that Javascript is client side and can if allowed create some very good visual effects for the user.

 

So what is the current thinking on this matter.

 

Kind Regards

Link to comment
Share on other sites

Two words: "unobtrusive javascript"

 

I am one of those users who turns off javascript. I allow it for sites I trust, but most of the time I will bounce out of sites that dont work without javascript.

 

Unfortunately there isn't a client side option that can't be turned off. So what you do is create an entire site using zero javascript at first. Make the whole site so that it can be used without any javascript. Program all your form validations, functionality and everything.

 

THEN add javascript overtop. Javascript isn't meant to be a language to depended on. It's there to increase functionality, not to provide it in the first place. Its a great language and can do many wonderful things. But it should only be used as an extra.

 

Here is a GREAT article on unobtrusive javascript:

 

http://onlinetools.org/articles/unobtrusivejavascript/

 

This article opened my eyes to how javascript can be entirely separated from the page so that its not even present in the original (x)html. I follow all the practices in this religiously now, and my javascripting has become cleaner, less visible, and just a nicer user experience than pop-up alert windows that people use so much.

Link to comment
Share on other sites

Hello haku

 

Thanks for your reply and views. The link you provided is certainly very interesting and I can understand a little more your comments. My current site is constructed using zero javascript, to add javascript overtop will need a little more study on my part.

 

I am a little surprised that other people have not contributed to the topic because I am sure that they have valid views on this subject.

 

Thanks again for your views,

 

Regards

Link to comment
Share on other sites

To be honest, I think a lot of the people on this site are just amateur programmers who do it as a hobby (not that there is anything wrong with that!). So for most of them, programming in an ideal manner with clean well thought out code probably isn't a big issue. And if a person visits their site with javascript turned off, and decides to leave, its also probably not a big issue.

 

But for those of us developing commercial sites, its essential to build sites that work for everyone (or at least everyone using IE 6 and above or other browsers in my case). My company will not be impressed if some of our clients cant view our sites.

 

Plus I'm just an idealist. I like clean, pure code. I firmly believe in separating style, content and function (CSS, xhtml, javascript) into separate files. Its just better cleaner organization that is easier to read.

 

So the stuff I speak about isn't necessarily...necessary, but in learning and doing it you can become a better programmer/coder.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.