TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Is JavaScript Enabled?

29 pointsby mileycyrusXOXOabout 6 years ago

7 comments

mileycyrusXOXOabout 6 years ago
I made an extension and needed to be able to quickly validate whether js was enabled. Surprisingly, there weren&#x27;t any stupid simple websites to do that so I set out to make one. A few hours later <a href="https:&#x2F;&#x2F;isjsenabled.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;isjsenabled.com&#x2F;</a> was online.<p>I had a lot of fun carefully picking the colors, coding the site from scratch and stopping all work to solve a very tiny problem. It reminded me, there&#x27;s nothing better than the feeling of having made something, no matter how small it is.<p>Thought it would be fun to share.
czralmost 6 years ago
Minor, but instead of:<p><pre><code> status.setAttribute(&#x27;style&#x27;, &#x27;display:none&#x27;); </code></pre> I would suggest just writing:<p><pre><code> status.style.display = &quot;none&quot;; </code></pre> (and similarly for the other DOM modifications; see [0] for a discussion of setAttribute vs property syntax)<p>[0] <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;3919291&#x2F;when-to-use-setattribute-vs-attribute-in-javascript" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;3919291&#x2F;when-to-use-seta...</a>
评论 #20073416 未加载
评论 #20073398 未加载
runarbergalmost 6 years ago
This is what I get when viewed in Lynx which certainly has JS disabled.<p><pre><code> Picture of a browser window. Javascript is disabled in your browser. Javascript is enabled in your browser. This text is in a &lt;noscript&gt; tag and should display if JS is disabled. </code></pre> <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;RihgnoD" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;RihgnoD</a>
评论 #20073411 未加载
_ZeD_almost 6 years ago
But... Why don&#x27;t you just use the &lt;noscript&gt; tag?<p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;noscript" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;no...</a>
评论 #20073362 未加载
评论 #20073347 未加载
z92almost 6 years ago
I browse JS disabled. And if some page doesn&#x27;t render and really want to read it, toggle it on with a single click using a browser plugin for that site only.
Causality1almost 6 years ago
I always get downvoted for saying I run NoScript with a whitelist but 90% of my browsing time is on sites I&#x27;ve been to before and I don&#x27;t think any other single security measure reduces your attack surface as much as turning JS off does.
评论 #20073301 未加载
评论 #20073306 未加载
评论 #20073430 未加载
评论 #20073310 未加载
na85almost 6 years ago
A suggestion:<p>Given the recent news that Chrome will soon prevent ad blocking and given ads can run untrusted JavaScript, the only sane choice is to disable JavaScript in the browser.<p>I suggest that you change the &quot;enabled&quot; colour to red, to highlight the user&#x27;s risky behavior.
评论 #20073314 未加载
评论 #20073424 未加载
评论 #20073285 未加载
评论 #20073277 未加载