Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Offtopic, but why do i have to enable Javascript to even see anything?


That is really weird. Technically the content is there all along (so it's not loaded in by JavaScript) but you still have to have JavaScript enabled for it to render. Who designed that!?

Edit: hahaha what. It appears the content is laid out with JavaScript. So basically they're using JavaScript as a more dynamic CSS. Let that sink in. They're using JavaScript as CSS.

It sorta-kinda makes sense for the fancy stream of comments but still... why is it a requirement!?


Very funny. They have a div #main with visibility:hidden. Removing that rule from dev tools displays the full page without enabling JS. The comments block is a solved problem with CSS. Basically any grid layout toolkit does that as their very first demo.


Yeah, if you are going to do that just for a fade-in transition at least set it to hidden with an inline script block then someone with script turned off they get the content. You block rendering until everything is downloaded, but then so does your needless transition.

If you are worried about it breaking in some browsers because you are modifying a tag that has not yet had its content completed so isn't accessible in the DOM yet, or because you use a DOM manipulation library that hasn't loaded yet due to lazy loading, have the script add an extra wrapper instead of modifying the existing tag [i.e. <script>document.write('<div id="iamanidiot" style="display:hidden">';</script>) directly after <body> and <script>document.write('</div>';</script> before </body>]. Or, of course, just don't...


> Or, of course, just don't...

I think that's really the takeaway here. Bytes and bytes of JavaScript, slower rendering time, and for what? Just say no!


Apparently some sort of useless fade-in effect is more important than the page content. This is the fix:

    #main {
        visibility: visible !important;
    }


Their trick also keeps noscript weirdos out though, which is a plus.


No, it didn't. I'm not about to run random Javascript, and the page was visible within ~3 clicks.

Page that are actually broken without Javascript only indicate that the author was lazy and unprofessional. Progressive enhancement is not hard.


>Page that are actually broken without Javascript only indicate that the author was lazy and unprofessional.

Or that they have kept with the times and understand the notion of opportunity cost.

>Progressive enhancement is not hard.

No, just redundant and for marginal benefit. The train has long left that station.

Search Engines (well, those that matter) and screen readers for a11y both work with JS.


> Or that they have kept with the times and understand the notion of opportunity cost.

That's not keeping up with times, that's poisoning the well because others do it too. By making such choices a site author is making the Internet worse for everyone.

I'm starting to think there should be some kind of "how not to be an ass on the Internet" course that would be mandatory before you're allowed to do business on-line.


Actually, weirdos are people making such pages. There is no valid reason for the content here to be not visible without JavaScript on. It's laziness and/or stupidity.


In Firefox, "View", "Page Style", "No Style". I assume other browsers let you do the same thing. This works for many pages that fail to render without JavaScript.


That's actually not off-topic. I wouldn't take web programming advice from someone who thinks displaying a blog article requires javascript.


The same reason you have to have electricity to watch TV.

It's a required part of modern web sites -- and it doesn't matter whether it's "really needed" for any particular site or not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: