简体   繁体   中英

Are there any browsers that cannot handle javascript?

I was looking at a "best practices" guide in relation to the inclusion of javascript in web pages (dynamic and static) which suggested that developers should always comment out javascript due to older browsers being unable to support the scripting language.

Is this true?

I tried searching for issues surrounding compatibility but could find nothing - I'm wondering if the information is out of date, as I've never heard of browsers having no idea what scripting is; a separate issue from javascript being deliberately disabled.

By "any" I obviously mean any non-discontinued browser.

Partial duplicate: What web browsers do not support Javascript? and how to identify which browser is client using?

Javascript is widely available, but there are some cases where you cannot rely on its presence.

First of all, the NoScript extension has been pretty successful - I'm not sure if it is still widely used, but you can except that at least a small portion of your users will use it (even if they whitelist your website later).

Another thing to keep in mind is that some browser just cannot implement a good Javascript engine. The best example which comes to mind is TTY-related browsers such as lynx .

Finally, don't forget that some people here are disabled, such as blind peoples, and have to use very specific browsers, which probably cannot work very well along Javascript.


[edit] About the specific "developers should always comment out javascript due to older browsers being unable to support the scripting language" question, I assume you're referencing the following pattern :

<script>//<!--
    Actual source code here
//--></script>

Afaik, every modern browser knows what a script tag is, even if they ignore it. I'm not aware of any browser which prints script tag contents.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM