TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

JavaScript Disabled: Should I Care?

42 点作者 lemonberry超过 10 年前

15 条评论

eric_bullington超过 10 年前
I think it&#x27;s critical here to distinguish between full client-side application (e.g., gmail) and an informational web site (e.g., a news site, a blog, or code documentation). It&#x27;s a bad idea to require Javascript for the latter, but it&#x27;s equally silly to try to build a fully-responsive client application using no Javascript, or progressive enhancement.<p>In several of my recent sites, there&#x27;s been a main company site requiring no Javascript, but then a portal to one or more applications or services that requires Javascript.<p>In these cases, Javascript is taking the place of what before might have been Java applets, Flash apps, or Silverlight applications. But it&#x27;s arguably more secure, fairly standardized, and &quot;installed&quot; by default.<p>And in the cases of full browser applications, I think it&#x27;s silly to argue against requiring Javascript. You simply can&#x27;t build a fully responsive client-side application using just HTTP calls and static HTML, no matter how performant the server side.<p>And I will absolutely continue to use &lt;noscript&gt; tags for browser apps that run on Javascript, since it&#x27;s rather rude to just show a white screen with no indication of what the problem is to users.
评论 #8347580 未加载
评论 #8347552 未加载
评论 #8347896 未加载
评论 #8347553 未加载
评论 #8355500 未加载
dubcanada超过 10 年前
I think sacrificing functionality for 99% of users to accommodate 1% is sheer bloody mindedness.<p>We can design our sites using a technique called Progressive Enhancement.<p>Sounds to me like he just said you shouldn&#x27;t do that, and then tells you to do it.<p>You don&#x27;t create a website, and then provide an enhanced version for those with javascript enabled. Not unless you are building a website in 1995. You provide a normal version and a degraded version for those with missing parts.<p>The problem is Javascript is part of the browser, when you disable part of the browser. Stuff won&#x27;t work... It&#x27;s not up to the web developer to accommodate that. If someone has a virus on their computer, you don&#x27;t build your website expecting ads to be placed on it. If someone has an extension that changes every word on the page that starts with v to cheese. You shouldn&#x27;t rewrite your website to not use v words.
scrollaway超过 10 年前
&quot;Why might JavaScript be unavailable even to users who have not disabled it?&quot;<p>The paragraph makes only the one point of mixed-content but that is not the only possibility.<p>Another possibility is: javascript (or js dependency) is hosted on a CDN and the CDN is unavailable (down, blocked by company&#x2F;state filters, ...).<p>Another could simply be that part of the js is broken for some reason and did not execute further (could be because part of the js is generated per-user in a dumb way and our user is little bobby tables, could be because of caching issues, could be a critical bug not caught in QA, ...).<p>Another reason is that loading assets could be extremely slow for the user and they will temporarily see the site in a broken state. I&#x27;m suffering from this myself currently - I&#x27;m out of the country on a massively throttled 3G. I&#x27;m closing a lot of sites before they finish loading their JS because I don&#x27;t have all day. The type of speed I&#x27;m dealing with here exists in many parts of the world and it is unsafe (and extremely inconsiderate) to assume everyone will load all assets within seconds.
评论 #8347495 未加载
评论 #8347520 未加载
评论 #8357721 未加载
matteodepalo超过 10 年前
To be fair here&#x27;s the opposite view: <a href="http://tomdale.net/2013/09/progressive-enhancement-is-dead/" rel="nofollow">http:&#x2F;&#x2F;tomdale.net&#x2F;2013&#x2F;09&#x2F;progressive-enhancement-is-dead&#x2F;</a>
评论 #8347781 未加载
joelanman超过 10 年前
GOV.UK ran some stats on who wasn&#x27;t running JavaScript and why:<p><a href="https://gds.blog.gov.uk/2013/10/21/how-many-people-are-missing-out-on-javascript-enhancement/" rel="nofollow">https:&#x2F;&#x2F;gds.blog.gov.uk&#x2F;2013&#x2F;10&#x2F;21&#x2F;how-many-people-are-missi...</a>
lcampbell超过 10 年前
The article calls out &lt;noscript&gt; messages as a bad practice, but as someone who routinely runs without javascript enabled, I much prefer webpages to explicitly point out that the issue is on my end, not theirs (rather than, e.g., a white screen of death).
评论 #8347741 未加载
评论 #8347560 未加载
TheAceOfHearts超过 10 年前
For document-based websites, I go JS-free. My blog works without JS (except for comments, because they&#x27;re from disqus and I&#x27;m lazy). And for public facing document websites it&#x27;s usually possible to cache everything so it&#x27;ll be REALLY fast.<p>But if I&#x27;m making an actual application, it&#x27;s a lot simpler to disregard users without JS. For example, I use angularjs, and if you take full advantage of it, you always just send the user the same index.html page and the server has a bunch of JSON API endpoints. Then you let the client-side router take over.<p>If you really want to support JS-free users on your application, you&#x27;re probably better of making a separate limited version of your application instead of having multiple fallbacks in the same page.
ised超过 10 年前
&quot;Why do some users choose to disable Javascript?&quot;<p>Well, you could also ask why do some developers choose to write applications that retrieve HTML but do not process Javascript?<p>If I recall correctly, for a while the links and elinks browsers experimented with processing Javascript but eventually if I&#x27;m not mistaken the developer decided to drop it in future versions.<p>Why? I do not remember but I know that he did offer an explanation.<p>I have always thought Javascript generally benefits web developers more than users. And this is not a quality inherent of the language, but it has to do with how this particular language is used in practice.<p>When I download someone else&#x27;s C code, compile and run it, I generally have a rough idea of what that code is going to do.<p>When a &quot;modern web browser&quot; (=not a text-only one) runs any and all Javascript from any web resource, I generally have no clue what that code is going to do. These browsers will automatically load resources from many sources other the one hosting the page to which the user navigates. They will make numerous connections to other addresses (to retrieve &quot;third-party resources&quot;) instead of just one to the address the user specifies. Often the Javascript code is coming from a third party. Imagine a pop-up asking for permission each time the browser wants to run Javascript code from somewhere. In the early days of browsers, if I recall correctly, you could require the browser to do this (and the same goes for accepting cookies). I never considered this practical back then and it is certainly not a solution that would be practical today.<p>And today, when the company that writes the &quot;modern web browser&quot; assures me that it will protect me from malicious Javascript, I have no clue what the &quot;modern web browser&quot; itself is going to do to try to accomplish that. Because I cannot easily compile the &quot;modern web browser&quot; myself. It is not meant to be compiled by users. There is a large amount of implied trust.<p>It&#x27;s somewhat like downloading random Windows applications one finds on the www, installing them and running them. Do you trust that Microsoft or some anti-virus company will protect you? That is a tall order.<p>Whereas if you merely refrain from downloading and installing such programs, if you refrain from blindly opening attachments in email, then you avoid that risk.<p>By not running Javascript, the user avoids the risk of malicious Javascript, and may even avoid the need for a &quot;modern web browser&quot;... and thereby the high complexity (=higher risk of insecurity) that comes with it. Keeping the user safe from malicious Javascript is a tall order for any browser to fill.<p>All that said, if I the user can get the information I want from the www without having to run Javascript and hence a &quot;modern web browser&quot;, then I will always choose the non-Javascript option simply because _it is often faster and more efficient_, regardless of any possible security benefits.<p>Thankfully, I rarely need the &quot;modern web browser&quot;, even for webmail. It is true that Javascript is frequently an impediment that stands between the user and fast and efficient computing but in my experience it is rarely a show stopper for the user who disables it.<p>To answer the OP&#x27;s question: No, as a developer, I do not think you should care. Javascript is a fun language and people will pay you to write in it. For the Javascript developer, life is good. Carry on.
joshstrange超过 10 年前
I work on a web app that is half and half when it comes to depending on JS. The site started as MVC PHP app that was all server-side but over the years JS was added to do client-side validation and other UI&#x2F;UX enhancements. In part because the customers asked for them and because something would have been extremely tedious and frustrating without JS+AJAX.<p>As time wore on entire components were built with JS making them unusable with out it. I have some co-workers who want to move all logic back to the server side or at least provide fallbacks for non-JS users but I strongly oppose this. We have parts of our app that use google maps that would be completely unusable without JS and those parts are arguably the most important and central parts of our app.<p>They want to approach it as &quot;Lets make as many parts usable without JS as we can&quot; while my opinion is &quot;If parts of the app absolutely require JS and are heavily used parts then why waste our time worry about people with JS disabled&quot;. Especially since a lot of the server-side only parts of the app could be greatly enhanced with JS. I should also mention that this web app is NOT public facing and is only used by our call center (which we control the browser, newest chrome) and various groups of people using our software which so far all have JS enabled.<p>I agree that a news website does not need to have JS-required pages for 99.999%+ of their content. If they are taking the time to enhance their site with JS then I believe they probably also have the time (and financial incentive) to make their sites work without JS. Web apps on the hand are a different story. Once you have a significant number of users it might make sense to invest the time in making a fallback or slimed down version (I&#x27;m thinking Google&#x2F;Facebook&#x2F;etc) but for most companies I don&#x27;t think supporting a JS-disabled web is a good use of time.
评论 #8347764 未加载
erkose超过 10 年前
An alternate view is: If your site requires javascript (or cookies or registration) we don&#x27;t use it. There are plenty of sites that work better with javascript, but are still fully or mostly functional without it. This is where you will find those of us who choose not to allow sites to run javacript in our browser. As an example, nytimes requires registration. The registration page is the extent of my interaction with their site. I turned to theguardian many years ago, and, while I value nytimes, I wouldn&#x27;t be able to quantify any meaningful difference between the two.
hawkice超过 10 年前
The author provides a fully general argument for supporting IE 5, Lynx, semantic HTML, lack of minification, testing with the website readers for blind people, and internationalizing immediately.<p>I highly recommend discussing the actual cause of whether or not stuff like this gets done: is it worth the time? Saying you can use a technique to help out a very small portion of users, therefore you should, lacks the nuance that (we observe) people need to make these choices.
drabiega超过 10 年前
I&#x27;ve always considered disabling javascript or using something like adblock to be bad form. Ads are annoying, but they&#x27;re paying for the content I&#x27;m consuming.
评论 #8349934 未加载
serve_yay超过 10 年前
As always, depends what you&#x27;re building. I work on a web app used by a small group of customers to do very valuable things, where requiring JS is a no-brainer. You probably shouldn&#x27;t require it to show a simple news article or blog post, though.
评论 #8347602 未加载
unclebunkers超过 10 年前
Considering the number of javascript client&#x2F;single web page apps out there, not having javascript is simply not an option. Because of the nature of the sites I&#x27;ve been building, there is no point to using if you don&#x27;t enable javascript.
评论 #8347612 未加载
评论 #8347606 未加载
EGreg超过 10 年前
One consideration remains: what shows up on the screen before JS goes to work. Otherwise you should probably fade in the contents as they&#x27;re loading.