Live data from Hacker News

You might not need JavaScript

youmightnotneedjs.com

91–100 of 254 posts

Re: You might not need JavaScript

#91
post #85

So let's show off what you can do without JavaScript...but also include SCSS as a dependency when the opening paragraph complains about a JavaScript dependency? Madness...but I digress. Some of these are cool examples. Others, like the modal, won't scale very well because now you can trigger modals by tabbing (breaks keyboard navigation) or most of the form examples as you'll likely hit many endpoints that require JS…

Compile time requirements and runtime requirements are different things.

You could go the other way just as easily, and eliminate the css requirement. Doesn't mean it's the best way to do a given thing.

Also, the examples don't support a lot of use cases... the accordian and tab examples, while interesting will submit goofy information if they're containing multi-part forms.

The image changer will break other bits of navigation, or similar changers by abusing the target. Similarly, the lightbox example doesn't have a slideshow support, and even if so, would probably be as/more complex than just using JS.

Also, how many of these examples work in IE11? This browser will be around a while for public facing sites, and has some really broken implementations of newer css features like calc (which doesn't work in several scenarios).

Re: You might not need JavaScript

#92

Earlier quoted context omitted.

You should surely realize that requiring SCSS and requiring JS are two very different concerns.

Of course they're different but the article mentions JavaScript as a dependency. SCSS would also be a dependency it just comes into the stack at a different place but it's there nonetheless. Regardless my other points still stand.

One is a server-side depencency and one is a client-side dependency. Don't conflate them.

Re: You might not need JavaScript

#93
post #9

The you don't need jQuery website had a concrete use case - you need not include an entire library into your website for some simple tasks which makes your website faster. Though, this site is cool in showing the power of CSS, I am not sure if there is any specific advantage of using CSS over JS to design tabs, sliders, etc. Just use the best tool for the job!

The Tor web browser disables most (if not all?) Javascript by default as a security measure.

Avoiding Javascript is an advantage if you want your website to be accessible to Tor users.

If your website only handles basic things like form inputs and it breaks when Javascript is disabled, then you have not made it accessible.

Re: You might not need JavaScript

#94

Earlier quoted context omitted.

Of course they're different but the article mentions JavaScript as a dependency. SCSS would also be a dependency it just comes into the stack at a different place but it's there nonetheless. Regardless my other points still stand.

One is a server-side depencency and one is a client-side dependency. Don't conflate them.

SCSS isn't even server side, it's developer side. Your build pipeline can be ugly as sin, the client should never care.

Re: You might not need JavaScript

#95

So let's show off what you can do without JavaScript...but also include SCSS as a dependency when the opening paragraph complains about a JavaScript dependency? Madness...but I digress. Some of these are cool examples. Others, like the modal, won't scale very well because now you can trigger modals by tabbing (breaks keyboard navigation) or most of the form examples as you'll likely hit many endpoints that require JS…

I agree, but I think you're putting the emphasis in the wrong place. A SCSS dependency isn't that bad because the client will never see it.

What is bad is code that's hard to maintain. When I did a stint of front end development recently, I went in with the mindset that "JavaScript is evil for the user and therefore should not be used when avoidable". I discovered after a while that although you can replace JavaScript with CSS sometimes, the resulting code is often much more difficult to understand and modify than the original JavaScript would have been. It's no longer in my interest to avoid JavaScript at all costs, as was the case before.

You touch on this with your "overcomplicating" sentence, but I feel like it didn't get the spotlight it deserved in your comment!

Re: You might not need JavaScript

#96
post #84

Earlier quoted context omitted.

How is it consistent UI when it doesn't match your design and looks and works very different in every browser?

It's consistent with the platform, i.e. the alerts are native

You should experiment with these. They are different on different browsers on the same platforms.

Re: You might not need JavaScript

#97
post #72
post #66

Earlier quoted context omitted.

The form element type is perfectly enough for frontend validation. You should do the rest on the backend anyway.

I don't get where the popup ( when you don't match the pattern) in the form example is coming. Is it from the browser? Can someone explain?

It's from the browser, using the form input attributes they describe.

Re: You might not need JavaScript

#98

Earlier quoted context omitted.

You should surely realize that requiring SCSS and requiring JS are two very different concerns.

Of course they're different but the article mentions JavaScript as a dependency. SCSS would also be a dependency it just comes into the stack at a different place but it's there nonetheless. Regardless my other points still stand.

SCSS is not a dependency for the user, this gets rid of the requirement of having JS and having it enabled and any page that works without JS is a better page than one that requires it.

Re: You might not need JavaScript

#99

Wow at the color picker. Funny that chrome seems to use my windows system color picker.

, standard HTML5. It’s not got brilliant support though: http://caniuse.com/#feat=input-color

Wow even the Android browser implements it. IE and Safari are lagging again...

I was surprised to see some Linux-style color picker pop up. It looks a lot like the one GIMP uses. Wonder if Firefox implemented that or they depend on something that does, and in the latter case, what's that dependency?

Re: You might not need JavaScript

#100
post #66

Earlier quoted context omitted.

The form element type is perfectly enough for frontend validation. You should do the rest on the backend anyway.

When submitting a form with an incorrect pattern in Firefox, the validation behavior highlights the relevant textbox in red for a second, and removes its contents. This default behavior gives a very poor user experience.

And if we spent half the time we collectively spend making JavaScript validation programs on making the Firefox validation behaviour better, it'd not be this way.

Who goes first? Not me!

Post reply on HN