Once the page loads, there is only so much you can do to meaningfully impact the interactions with pure HTML and CSS.
When I click the ❤️ button on this post, a couple things happen:
We send a browser request without reloading the page, all in JavaScript, to let the server know what I just did, and to add it to the database.
Assuming this is all successful, we need to add a new "success" state class to the element.
Some things can be done with pure CSS and HTML but it's always going to be limited. JavaScript is a full-on programming environment loaded into your browser. You can do basically anything, including updating the DOM to your hearts content.
Thanks Ben! I guess it's about being patient, learning, and then seeing what it can do. I'm such a "why" person lol. Which I guess is what will make me a great developer.
Yeah, asking why a lot will indeed make you great.
But it's also a complicated craft, and the why questions go deeper and deeper and deeper, don't be afraid to always just do and let the why figure itself out as you go.
True! I just got through learning JavaScript basics so there's definitely a lot I still have to learn about it. Any tips on practicing the basics? Not quite sure what to do in that aspect. I've created some very simple things like "what's the biggest number" that my kids actually like messing around with, I've done a simple password validation function... things like that.
I have gotten a ton of mileage out of seeing things on posts or on sites or just mentioned and going "I wonder if I can do that." Even if it's a huge fail -- you can learn a ton by trying. I know I also learned a ton reinventing a billion wheels. So sort of -- how to do things super manually. How to copy an entire HTML element "by hand" with JS -- don't use any packages or helpers, just builtin browser APIs. How can you use JS to get that element, all in contents and everything, to another spot in the page? that kind of thing.
You can do so many different things with the same code: desktop app, chat bot, website, Excel addin, web API... Such a wonderful gain in efficiency, collaboration and knowledge sharing that any inefficiencies of the actual code are really insignificant in comparison.
Once the page loads, there is only so much you can do to meaningfully impact the interactions with pure HTML and CSS.
When I click the ❤️ button on this post, a couple things happen:
Some things can be done with pure CSS and HTML but it's always going to be limited. JavaScript is a full-on programming environment loaded into your browser. You can do basically anything, including updating the DOM to your hearts content.
Thanks Ben! I guess it's about being patient, learning, and then seeing what it can do. I'm such a "why" person lol. Which I guess is what will make me a great developer.
Yeah, asking why a lot will indeed make you great.
But it's also a complicated craft, and the why questions go deeper and deeper and deeper, don't be afraid to always just do and let the why figure itself out as you go.
True! I just got through learning JavaScript basics so there's definitely a lot I still have to learn about it. Any tips on practicing the basics? Not quite sure what to do in that aspect. I've created some very simple things like "what's the biggest number" that my kids actually like messing around with, I've done a simple password validation function... things like that.
I have gotten a ton of mileage out of seeing things on posts or on sites or just mentioned and going "I wonder if I can do that." Even if it's a huge fail -- you can learn a ton by trying. I know I also learned a ton reinventing a billion wheels. So sort of -- how to do things super manually. How to copy an entire HTML element "by hand" with JS -- don't use any packages or helpers, just builtin browser APIs. How can you use JS to get that element, all in contents and everything, to another spot in the page? that kind of thing.
I didn't even know it was possible to recreate just in JavaScript. It's definitely a powerful language. Thanks!
You can do so many different things with the same code: desktop app, chat bot, website, Excel addin, web API... Such a wonderful gain in efficiency, collaboration and knowledge sharing that any inefficiencies of the actual code are really insignificant in comparison.
I actually try to keep an up-to-date list of what you can do with JS, and is challenging :))