Intro to Scripting
00:57 when you click on a link or submit a form. That's actually really nice. Like imagine if every time you'd like to post on social media, it did a full page refresh. No, thanks. No, no, no, no. I would like fewer posts. Also, pending UI, the ability to just add a little spinner in place, or the little bar that goes across the top,
01:52 So like being able to make it so if I navigate to a page, I can preload all of the data so that it shows up in this prefetch cache. So regardless of how fast my network is, it can be really fast to get to that page. So those are a couple of the reasons
03:10 and making sure that if there's multiple submissions, what do you do with that? And if we go here and then we say, I wanna go here instead, the browser takes care of canceling things for us automatically. Luckily for us, Remix is going to emulate the browser's behavior. So you really don't have to worry about this very often at all.
03:29 But that is something that you do need to be aware of happening, is once you add scripts to the page and you start in a Remix app and you have the uppercase form and the link and everything, that's gonna prevent default, which is the desired behavior. But now all of a sudden, Remix is emulating the browser behavior for us. Another thing you're gonna need to know
03:49 for this exercise is, we have an entry file for our client. And I'm gonna tell you a little bit about how there are two bundles of our application, and one for the server and one for the client and stuff like that. But it's useful for you to know that we also have a place that's our entry for our client-side code.
04:09 So if you need to run some client-side code before or after we hydrate the browser and stuff like that, you can do that here. And then we also have some of these special components that we've got. We've already talked about the links and meta, but we also have scripts. And there are a couple other components
05:04 if you actually are inputting user input into there. So we will be using this and it is totally legit and not a problem. But yeah, just don't ever use this dangerously set inner HTML with user submitted content. So with that, I think you should have enough to get going on the first step of this exercise. So have a good time with it.
05:24 And yeah, you rock.