Javascript and I are friends.
Javascript is a powerful and useful language for adding interactivity and functionality to your web page. This is a good thing. Great things can be done with javascript. In fact you can do things with javascript that are impossible with html and css alone.
If you have been paying attention over the past few years you will have noticed that from time to time javascript was used by hackers to attack systems with hit-and-run viruses. Sometimes the javascript was the core attack. And sometimes javascript was simply the mechanism used to load the core attack.
In any case, during these times of attack it was recommended by security type experts to turn off javascript except for trusted websites. In fact a rather popular addon for Mozilla called NoScript was written to administrate this function of allowing and dis-allowing javascript on individual websites.
Yes, browsers were told to turn off javascript and given instructions on how to do so. Meaning that during these incidents if that user had come by your website any javascript on your website would be dis-allowed.
Does this mean that we should not be using javascript?
This does not mean that one should not use javascript. However, unless you happen to work for a 900 pound gorilla of a website it does mean that you should guarantee that navigation and other critical components of your website will function even in the absence of javascript.
Amazon can insist that all viewers allow javascript before opening the first page. This is because they are that well known and have that much clout. Amazon's user-base is already well aquainted with the site and have developed a trust for Amazon. Whether this is assessment of trust is realistic or not is not the point. The point is the user has the trust and will easily take the time and go through the trouble of turning on javascript for Amazon as a trusted site.
Any new customer that comes to your website is a stranger to you at first. That's the way it works. If you are not so big that users have developed a sense of pre-knowing, then that customer arrives at your front page they are strangers to you.
So, given that you are not that well know, it would be a good idea to let viewers poke around on your website before insisting they allow javascript. (perhaps during check-out)
In practical terms this means that fancy javascript drop-down menus can be a problem. With javascript turned off the user will not be able to access menu options in order to visit your site enough to gather trust. However, a left-side accordion-type menu can work just fine. Just make sure that the default state is open.
Just for the heck of it I created a system of expanding and contracting sub-sections on one of my web pages. That page is Review of Programming I do for Galaxy Website Design.
If you look at this page with javascript turned off you will see a bunch of headings and associated descriptive content -- fully expanded.
If you look at this page with javascript turned on, you will see a bunch of headings in a list type form. If you click on a heading it will expand to reveal the associated text.
I do this by keeping the default state of the content as visible. AND, then with javascript I hide the content. That means the content is visible to those who have chosen to turn off javascript.
However, for those with javascript the page is made a bit more fun and perhaps easier to digest.
On this javascript sample page you will see a large graphic on the left with three small graphics below it. If javascript is turned on then clicking on any of the smaller graphics will cause its larger version to appear above in place of the existing graphics. If javascript is turned off then clicking does nothing.
In the case of no javascript (the worst-case scenario) the user can still see and appreciate the alternate views of the product -- albeit much smaller.
This is my idea of perfect functionality -- using javascript to add additional functionality and interactivity to a web page without withholding a devastating amount of functionality from the non-javascript enabled browsers.