views:

120

answers:

6

isnt javascript enabled in all webbrowsers by default?

if yes, does this mean that i can use ajax/javascript in my webpages without bearing in mind that maybe some browsers wont be able to use my website?

i dont want to create another version of the page to display non javascript content.

what do you think?

EDIT: it doesnt seem that gmail is working with javascript disabled. and SO works bad with it disabled:)

+5  A: 

Usually it is enabled, but users can disable it or there may be some corporate policy to not allow certain user groups or machines to run javascript in browsers. It is always better to include <noscript> warning or message to tell the user that page will not work without js.

TheVillageIdiot
+12  A: 

No, you cannot assume that javascript is enabled.

astander
The only safe assumption to make - code for the worse case and then build on that.
middaparka
Yes, very true, and we all know what they say about assume (ass-u-me)!!! X-)
astander
+1  A: 

Generally, Yes. Certain settings might not allow this or the person has opted to disable it all together. But I would ask yourself if your'e ok with losing some possible visitors due to a lack of javascript support. If the site is as such that it needs to service all, then you will probably need create fallback methods to handle non-javascript use.

nowk
+3  A: 

Yes, JavaScript is enabled by default in mainstream web browsers.

But quite apart from making your site work for users that are more security-conscious than most and turn it off, you will want it to work in things other than mainstream web browsers, such as accessibility tools and search engines. Hide all your content so that it only appears with JavaScript or Flash and you're not going to be coming up very high in Google.

i dont want to create another version of the page to display non javascript content.

This is why you create one version, as plain HTML, then add the progressive enhancement sauce.

bobince
A: 

Javascript would NOT be enabled by default in a text-mode browser such as Lynx

Strictly speaking this answers your question in the negative, but you may wish to ignore them, because it's a tiny segment of the browser market.

pavium
+2  A: 

isnt javascript enabled in all webbrowsers by default?

All browsers? No, although it is in the majority.

However, users turn it off. System administrators turn it off. People install the NoScript plugin. It isn't guaranteed to be on.

Most people care about bots (such as the GoogleBot indexer) being able to access their content too, they don't support JS.

if yes, does this mean that i can use ajax/javascript in my webpages without bearing in mind that maybe some browsers wont be able to use my website?

No.

i dont want to create another version of the page to display non javascript content.

Build on things that work

David Dorward