I am working on a site that will involve a lot of Javascript to show/hide elements in accordions, as well as other things. I want to make sure that even people that do not have Javascript enabled will be able to access all of the site’s content (even if it is a little less pretty/interactive). I am not sure the best way to go about doing this. I know you can use the tag, but I know that cannot be the best way. It doesn’t make sense to have to essentially have two versions of the site, one for Javascript and one for not.
As I am still building the site, I thought using Apple’s site would be a good example. On any of their product pages (say http://www.apple.com/ipod/) they have their products at the top and then other options (Applications, iTunes & More, etc.) that when you click it shows these next elements. It looks awesome. But if you have Javascript enabled, you no longer get the cool interactive interface, but you do have all the products in a list. How would you go about doing this?
The solution doesn’t necessarily have to be the way that Apple does it. I just thought it was a good example to illustrate what I am trying to do.
You’ll need to Check if browser has javascript enabled. You can use the below function and onload it in your body tag. Based on whether the browser has js enabled or disabled, you can either redirect user to another page or do other things.