This is a test.
ok everything works
that was fun but now i don't know what else to do here lmao, i just wanted to learn a little bit of javascript
What was the test?
I wanted to build something that works like the PHP function "include()" where you just write "include('filepath/file.php');" and whatever it is you're including, be that HTML, Javascript, or more PHP, is inserted onto your website. It's extremely useful for whenever there's something that appears on multiple pages, because if you ever have to change it, you only have to change it once. For example, if you want your site to have a menu at the top of every page, you can do it via having "include('filepath/menu.php');" at the top of each page of your site. And then, if you ever have to add another link to that menu, you only have to update your "menu.php" file, and it changes globally.
Saves time! Ensures you don't forget anything!
Unfortunately, you can't use PHP here, and there is no Javascript equivalent.
Or, well. Not without effort, at least.
I decided to spend some time putting forth that effort, and I got it working! I have a menu, header, and footer file that I can just update once, and then they'll update across this site.
There's not much I can do about the thing where it jumps around a bit when you load a page--that's just Javascript being Javascript. PHP assembles everything on the server before handing you the finished webpage, so there's no flashing or movement to be had. Javascript, however, is putting everything together live in front of you, so you get to watch the page assemble--that's what that movement is.