STOP Using JavaScript For These 5 Things!

  Рет қаралды 17,051

James Q Quick

James Q Quick

Күн бұрын

You can do all of these things WITHOUT JavaScript? I learn something new every day.
Original Article - www.htmhell.dev/adventcalenda...
Kilian - kilianvalkhof.com/
*Newsletter*
Newsletter 🗞 - www.jamesqquick.com/newsletter
*DISCORD*
Join the Learn Build Teach Discord Server 💬 - / discord
Follow me on Twitter 🐦 - / jamesqquick
Check out the Podcast - compressed.fm/
Courses - jamesqquick.com/courses
*QUESTIONS ABOUT MY SETUP*
Check out my Uses page for my VS Code setup, what recording equipment I use, etc. www.jamesqquick.com/uses
*TIMESTAMPS*
00:00 - Intro
01:00 - Custom Toggle Switch
02:30 - Datalist, Native Autosuggest
03:30 - Color Picker
04:15 - Accordians
05:10 - Dialog Modals
06:26 - Bonuses
07:15 - Polypane Browser

Пікірлер: 53
@b1mind
@b1mind 5 ай бұрын
Great to see more people sharing how powerful semantic HTML/CSS is these days.
@naterpotatoers
@naterpotatoers 5 ай бұрын
I’ve been using the dialog element a lot lately. It’s super nice. Another thing that I don’t think enough people know about is the HTML Drag and Drop API. Too many people instantly reach for a package to do this when it’s overkill. HTML has that baked in already
@CommDao
@CommDao 5 ай бұрын
Collapsible boxes was something a stumbled on a few years back. Might've overforced it into everything, but I dig it!
@TheMeticulousMoo
@TheMeticulousMoo 5 ай бұрын
Wow, I'm really impressed with the "datalist" element. Thanks for sharing man!
@Stratelier
@Stratelier 5 ай бұрын
I remember (back in the 2000s) coding a nested heirarchial form listbox (basically, accordions inside accordians) via Javascript, because it was much more efficient on network bandwidth for the browser to cache a copy of the list's raw data and dynamically populate the form listbox with it, than to statically include the list with every HTML page request. (This was a huge list with thousands of options nested into hundreds of categories, and highly prone to misclicks were it presented as a single flat list)
@CyberTechBits
@CyberTechBits 5 ай бұрын
I did know about all of those only because I've had to implement every one in an enterprise PWA. I took the checkbox styling in a different direction that uses the accent-color which provides very nice styling for checked and unchecked states so I don't need nearly as much CSS! Thanks for the video!
@nomadshiba
@nomadshiba 5 ай бұрын
6:20 thats more of a `` expecting an input thats why it uses js. there is actually `popover` attribute to create popups that doesnt require js and also closes when you click on the backdrop unlike ``. also using all these over a js solution has other advantages as well, such as full accessibility support
@derickmoncado
@derickmoncado 5 ай бұрын
Great tips man! I've only known about the native dropdown/accordion feature in HTML.
@borisbojic
@borisbojic 5 ай бұрын
What’s totally missing in this video is the browser compatibility. Does it work in all major browsers? Chrome only? Firefox?
@IainSimmons
@IainSimmons 5 ай бұрын
They should all work in the 3 main browser engines, with the one exception being styling of the details marker in Safari which still uses a vendor prefixed property (details in the original article).
@harleyspeedthrust4013
@harleyspeedthrust4013 5 ай бұрын
I love this kind of stuff. Semantic HTML + CSS is a lot better than a million divs with special class names that you have to remember to use in specific places. I try to avoid writing as much javascript as possible when building pages in plain HTML + CSS. I just wish there was more native styling for the select element, because I find myself using it a lot and being disappointed that CSS just doesn't do much for it. Thankfully our HTML pages are pretty simple (at work) so I can usually get away with the native select and some minimal styling.
@montebont
@montebont 5 ай бұрын
Nice one James. Best wishes for 2024 and thanks for sharing. I've used a few of them but the additional details are very helpful. I'll certainly look into Datalist. It might well be an alternative for my custom built "select" elements (200 lines of javascript) I do like our approach to let (latest) html and css do what they can best do.Bookmarked with 5 ******
@dbanswan
@dbanswan 5 ай бұрын
Accordian and dialog is neat, did use datalist earlier
@ste-fa-no
@ste-fa-no 5 ай бұрын
There are lots of HTML and CSS functionalities that help make better websites, without nested divs and unnecessary js. Remember many people live in places with limited connectivity or don't have the latest smartphone, let aside ads load.
@elephant_888
@elephant_888 5 ай бұрын
Really good article!! I think these ideas and HTMX will revive simpler frontend coding paradigms for certain.
@moopet8036
@moopet8036 5 ай бұрын
I don't think so. There have been a lot of cool features in HTML and CSS for a long time, but people don't tend to use them. The popular choice is always to install some JS-heavy alternative, and I don't see that changing. It's like how having a dozen nested DIVs all with utility classes (i.e. Tailwind) is preferred to just having one semantic tag and a couple of lines of CSS. It doesn't matter which is "better", trends gonna trend.
@kenscode
@kenscode 5 ай бұрын
I had no idea about a few of these, makes me realize I need to pay more attention to what HTML & CSS are up to because it could definitely make my life easier 😎
@Achelon
@Achelon 5 ай бұрын
I feel theres some people that skip html/css and are just enforcing js on a lot of stuff. They might still use div's for everything instead of semantic elements as well. Some of them still think Bootstrap is all the rave.
@mattburgess5697
@mattburgess5697 5 ай бұрын
I’ve seen any number of junior devs create something like this because it just hadn’t occurred to them to use a link. Recreating basic HTML form behaviour is also common.
@WebDevXpert
@WebDevXpert 4 ай бұрын
How to create button using HTML And CSS || CSS Round Checkbox Button || How to make CSS switch : kzbin.info/www/bejne/hGHQYpqre7umla8
@rrd_webmania
@rrd_webmania 5 ай бұрын
I use datalist for 10 years. It is always a good solution. Unfortunately Chrome on Android changed it to display the result list as bubbles at the bottom. Terrible ux imho
@mattburgess5697
@mattburgess5697 5 ай бұрын
I built a full component library leaning heavily on the use of HTML dialog for the modal. It has some caveats. A lot of things you would expect to work… just don’t. Clicking off the modal is not considered a close action. The back button will continue to navigate even with the modal up. But the hardest to deal with is scrolling. Scrolling will continue to be active in the window behind your modal. I had to implement a JS line that locks body scrolling when the modal opens. It’s not ideal.
@kilianvalkhof
@kilianvalkhof 5 ай бұрын
Now that :has() has landed you can also use that, no js needed! body:has(dialog[open]) { overflow: clip }
@Dev-Siri
@Dev-Siri 5 ай бұрын
i thought you were gonna talk about not using js for mysql
@mtwata
@mtwata 5 ай бұрын
I'm a pretty crappy frontend dev (not using any JS frameworks), which is probably the reason why I knew about all these features
@T25de
@T25de 5 ай бұрын
1:36 daisyUi utilizes the check Box often
@Kats0unam1
@Kats0unam1 5 ай бұрын
Amen
@doc8527
@doc8527 5 ай бұрын
Just to add more info for newbies (maybe even mid & senior level dev)? on top of the article, even though some of native components are fully functional nowadays across the browsers. But they are still working in subtle different ways in terms of the stylings and behaviors, which in worst case leads to inconsistent UX, the native components feels like out of touch from your entire application, and the feelings of bug. That's why eventually everyone moves to component libraries to ease out all the development hazards. As someone who actually implemented all of them in production and faced countless annoying issues from different browsers (mainly Safari, I just hate Safar every single day during that time). You definitely want to take the video, the articles with a grain of salt, as well as my opinion. Thing might change in the future. But it's good for you to at least implementing them once before using any component libraries. Always remember "it's working across browser" !== "functional with correct stylings and user interaction", people tend to forget the Frontend is not just about coding. You still need to do some manual tests even you have e2e.
@AlThePal78
@AlThePal78 5 ай бұрын
I seen them before but never used them myself :) but not all of them just saw this on another video
@mattinykanen4780
@mattinykanen4780 5 ай бұрын
Programming is one, but what are the other four?
@JamesQQuick
@JamesQQuick 5 ай бұрын
lmaooooo WILD!
@SzaboB33
@SzaboB33 5 ай бұрын
I would add another important thing that should not be done using JavaScript: Please do not use JavaScript to develop operating systems
@moopet8036
@moopet8036 5 ай бұрын
JS users: you mean there are elements other than DIV?
@nomadshiba
@nomadshiba 5 ай бұрын
yes i knew
@omomer3506
@omomer3506 5 ай бұрын
One day someone will make it possible to talk to the api from css........
@IainSimmons
@IainSimmons 5 ай бұрын
You can, if the API is built with only GET requests and image URLs. 😅
@SeanGoresht
@SeanGoresht 5 ай бұрын
Nope; no surprises here. All things I've been doing without JS for years now...
@geomorillo
@geomorillo 5 ай бұрын
htmx
@ficolas2
@ficolas2 5 ай бұрын
Stop using javascript for: anything that doesnt go on your browser frontend.
@CristianKirk
@CristianKirk 5 ай бұрын
Frameworks have generated lazy frameworkers. This is all very basic stuff.
@tusharagarwal5306
@tusharagarwal5306 5 ай бұрын
Stop using JavaScript. Period.
@GeneraluStelaru
@GeneraluStelaru 5 ай бұрын
I only use div.
@montebont
@montebont 5 ай бұрын
So did I for a long time. At the end of the day 90% of html is a box. But the roles and behaviour are different
@GeneraluStelaru
@GeneraluStelaru 5 ай бұрын
@@montebont True. The thig is I don't like having behavior split between HTML and JS, especially if I'm using a framework and the project tends to grow.
@LE8271
@LE8271 5 ай бұрын
Or just stop using JS
@montebont
@montebont 5 ай бұрын
Some of us can't. In my line of work (engineering apps) I must do loads of calculations...
@sohaibesohaib2914
@sohaibesohaib2914 5 ай бұрын
why would I not use javascript , internet speed is fast nowdays , phones has a large amount of memory , why even bother my self to hack the browser by using this complexe ::before and ::after
@montebont
@montebont 5 ай бұрын
It's not about load times :-) Using what's available in html and css might save you a load of design/coding/testing time in JS. That is - IMHO - the point James tries to make...
@franklemanschik4862
@franklemanschik4862 5 ай бұрын
Stop using KZbin to spread crappy infos
@b1mind
@b1mind 5 ай бұрын
Stop using YT comments to be a tired troll.
@franklemanschik4862
@franklemanschik4862 5 ай бұрын
@@b1mind the Titel and you are Trolls Stop using Chrome and Go to wget and curl unqualified......
@natescode
@natescode 5 ай бұрын
​@@b1mindSTOP commenting on KZbin comments from tired trolls
@montebont
@montebont 5 ай бұрын
For the life of me I don't understand what's so "crappy" about this? It's not James' opinion. He did put a lot of effort into making a video to share a few good ideas that might save you a lot of time and make you app less complicated by removing "custom code". You may very well disagree but that doesn't make it "crappy".
JavaScript Error Handling: 5 Things You Aren’t Thinking About!
14:42
From Junior To Senior React Developer - Best Practices
13:33
CoderOne
Рет қаралды 140 М.
Заметили?
00:11
Double Bubble
Рет қаралды 3,5 МЛН
🍕Пиццерия FNAF в реальной жизни #shorts
00:41
2000000❤️⚽️#shorts #thankyou
00:20
あしざるFC
Рет қаралды 11 МЛН
a day in the life of a Google software engineer
11:09
TechLead
Рет қаралды 1,3 МЛН
10 JavaScript Interview Questions You HAVE TO KNOW
13:41
James Q Quick
Рет қаралды 42 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 900 М.
2 better alternatives to overflow: hidden
11:04
Kevin Powell
Рет қаралды 150 М.
HTMX and Astro Are An Amazing Combo!
17:50
James Q Quick
Рет қаралды 7 М.
STOP Using Classes In JavaScript | Prime Reacts
14:02
ThePrimeTime
Рет қаралды 218 М.
ESSENTIAL JavaScript Extensions for VS Code in 2024
14:02
James Q Quick
Рет қаралды 28 М.
Why Does Everyone HATE JavaScript? (Yet Still Use It?)
18:08
Continuous Delivery
Рет қаралды 22 М.
BREAKING: jQuery V4 Is Here (YES REALLY)
12:30
Theo - t3․gg
Рет қаралды 183 М.
Looking Under the Hood of JavaScript
6:34
ThePrimeagen
Рет қаралды 176 М.
Заметили?
00:11
Double Bubble
Рет қаралды 3,5 МЛН