Updated 5 months ago
These cards are designed to follow on from the beginner HTML Sushi Cards, but don't worry if you haven't done those. There's not much HTML in these cards and it'll be explained when you see it. Either way, you'll be getting some music from the internet and setting up a player on the page so the user can pick which track they want to listen to. The first thing you'll need to do is look at your “music.html” file and see that it's pretty basic:
<html>
<body>
<div id="jsSpace"></div>
</body>
</html>
All you have there is the basic HTML code for a page with a div
(division) element with an id
attribute where the div
is called "jsSpace". What you need to do now is include a few JavaScript files on the page. You do that using the script
tag with the src
attribute set to the name of your file. You've got three JavaScript files:
The order you add the script
tags in is important because you need to load a piece of code before you can use it. You'll need to load them in the order listed above, like so:
<html>
<body>
<div id="jsSpace"></div>
<script src="techie-functions.js"></script>
<script src="functions.js"></script>
<script src="my-script.js"></script>
</body>
</html>
If you look in the preview of the page, you'll see that there's actually nothing visible on it right now! You're going to use JavaScript to insert HTML into the page. Specifically, you'll need to:
You'll start to do all of this on the next card.