News for hackers. Stuff that matters.
Re:You might not need JavaScript by jwblackwell on Wednesday October 12, 2016 @04:07AM (#12691119)
Does anyone else feel that a site called "You Might Not Need Javascript", probably shouldn't use Javascript?
Re:You might not need JavaScript by fenomas on Wednesday October 12, 2016 @04:26AM (#12691192)
Do any of the examples use Javascript? Or are you saying the site shouldn't use JS for syntax highlighting or whatever, even though that's not the sort of thing it claims JS isn't needed for?
Re:You might not need JavaScript by Retr0spectrum on Wednesday October 12, 2016 @05:20AM (#12691444)
If you look at the source, there are plany of JS files being loaded. Mostly from codepen, but also from the site itself.

I don't see any features of this site which should require javascript, so they should probably "practise what they preach".

Re:You might not need JavaScript by 9point6 on Wednesday October 12, 2016 @06:37AM (#12691726)
Technically, they're preaching that you might not need JavaScript rather than advocating against it
Re:You might not need JavaScript by eyelidlessness on Wednesday October 12, 2016 @12:24PM (#12694242)
Why would syntax highlighting need JavaScript?
Re:You might not need JavaScript by marxidad on Wednesday October 12, 2016 @02:23PM (#12695312)
The browser doesn't natively support syntax highlighting (they aren't features of HTML or CSS).
Re:You might not need JavaScript by xigency on Wednesday October 12, 2016 @05:52PM (#12696698)
That hardly makes sense. Changing the color of text is definitely a feature of HTML and CSS.

What's the lazy reason for not rendering that before serving the html page.

Re:You might not need JavaScript by eyelidlessness on Wednesday October 12, 2016 @05:16PM (#12696476)
It depends what you mean by "support". There are two things a JavaScript syntax highlighter is doing:

1. Classify each token (whether this is building up an AST or doing something more fuzzy/clever is immaterial for this discussion); 2. Construct a DOM tree (HTML) that is styled (CSS).

Step 1 does not have to happen client-side at all. Step 2 doesn't require JavaScript at all.

Re:You might not need JavaScript by kitd on Wednesday October 12, 2016 @04:20AM (#12691172)
Perhaps they needed Javascript ;)
Re:You might not need JavaScript by bo1024 on Wednesday October 12, 2016 @09:56AM (#12692826)
I was reading it with javascript disabled and very confused - are there only code snippets and no visualization of the examples? After reading your comment, I went back and enabled javascript and now can see the examples.
Re:You might not need JavaScript by dingo_bat on Wednesday October 12, 2016 @05:49AM (#12691548)
I blocked all js on the page and the examples just disappeared. I could just see the undecorated code snippets.
Re:You might not need JavaScript by crashdown on Wednesday October 12, 2016 @06:30AM (#12691690)
This website does not need JavaScript. It's progressively enhanced with it.
Re:You might not need JavaScript by vidarh on Wednesday October 12, 2016 @04:33AM (#12691222)
Depends on what it uses it for. It says you "might not" need it, not that you won't need it.
Re:You might not need JavaScript by marrs on Wednesday October 12, 2016 @09:23AM (#12692543)
Maybe?
Re:You might not need JavaScript by akerro on Wednesday October 12, 2016 @04:13AM (#12691146)
No?
Re:You might not need JavaScript by deviate_X on Wednesday October 12, 2016 @04:27AM (#12691197)
Yes?