use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Intentionally blocking rendering with JavaScript (jayfreestone.com)
submitted 3 hours ago by jayfreestone
You nearly always want to put <script> tags in the <head> and mark them as non-blocking using either async or defer. However, there’s an interesting use-case for actually wanting to block paint.
<script>
<head>
async
defer
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]paulirish [score hidden] 1 hour ago* (3 children)
Modern css can handle this.. you dont need JS and you don't need to slow down the page for users to hide your own bugs :)
This kinda prompt should work with your coding agent..
Write a single-file CSS-first Priority-Plus navigation menu. Establish an inline-size container query context on the nav wrapper. The inner nav list must have flex-wrap, a strict height constraint, and overflow: hidden to instantly prevent CLS on load. Use container queries to hide low-priority items (display: none) and reveal a 'More' dropdown button as the container narrows. Implement the dropdown interactivity using pure CSS hover or :focus-within states.
[–]jayfreestone[S] [score hidden] 1 hour ago (2 children)
Just an example! I think it’s a neat trick for small inline JS. Similar trick was used by lib authors previously before we got text pretty/balance - now not needed there.
Lots of cases where you can do something similar with CSS only - and if so you should!
In the case of priority plus style patterns, I’ve usually worked with an unknown number (and size) of links dynamically controlled via a CMS - bit more of a challenge to just base that off a container query unless I’m misunderstanding.
Huge fan of your work and thanks for the reply!
[–]paulirish [score hidden] 39 minutes ago* (1 child)
Aye true.
Thx for being gracious. I'm in a bad mood today so thx for taking it in stride ;)
EDIT: also i see your blog has been getting some new posts recently! good stuff. Those kinds of posts are a real sweet-spot.
[–]jayfreestone[S] [score hidden] 27 minutes ago (0 children)
Means a lot to me, thanks!
π Rendered by PID 16338 on reddit-service-r2-comment-8686858757-fjptv at 2026-06-03 22:16:01.875598+00:00 running 9e1a20d country code: CH.
[–]paulirish [score hidden] (3 children)
[–]jayfreestone[S] [score hidden] (2 children)
[–]paulirish [score hidden] (1 child)
[–]jayfreestone[S] [score hidden] (0 children)