This is the multi-page printable view of this section. Click here to print.
Preps
1 -
Psst: have a look at the JavaScript Console 💁
2 - Prep 01: 1.3, 2
Chapter 2 - How the Web Works
Read FunWebDev Chapter 1.3 and Chapter 2, then take the quiz in Canvas.
3 - Prep 02: 3.2, 3.4, and 3.5 & 8.2-8.5
3.4 - Structure of HTML Documents
3.5 - Quick Tour of HTML Elements
8.2 - Where Does JavaScript Go?
8.3 - Variables and Data Types
8.4 - Conditionals
8.5 - Loops
Read
- FunWebDev Chapter 3.2, 3.4, and 3.5.
- FunWebDev Chapter 8.2-8.5.
Simple Single Page
- Download the textbook cover images at the following links (Notice when you hover over the links that your browser’s status bar shows the address as an image file. In cases like this, consider right-clicking and choosing the appropriate option, e.g.
Save Link as...
.) - Use it to complete Hands-On Project 1 from the textbook’s page 117.
- Submit your ch03-proj01.html to the corresponding Gradescope assignment.
CodingBatJS
- Download codingjs-1.js
- Complete the following CodingJS activities (we recommend you do NOT do this in a Private tab):
- Paste each of your solutions from the above into the corresponding places in
codingjs-1.js
and submit this file to the corresponding Gradescope assignment.
4 - Prep 03: 3.3, 3.6, and 5.1 & 8.6-8.7-8.8.1
3.6 - HTML5 Semantic Structure Elements
5.1 - HTML Tables
5.3 - Introducing Forms
5.4 - Form Control Elements
5.5 - Table and Form Accessibility
8.6 - Arrays
8.7 - Objects
8.8 - Functions
8.8.1 - Function Declarations vs. Function Expressions
Read
- FunWebDev Chapter 3.3, 3.6, and 5.1 (skip chapter 4).
- FunWebDev Chapter 8.6-8.7 and 8.8.1.
Semantic Elements
- Download and extract the zip file containing the starter files
- Your goal is to complete Project 2 in Chapter 3 (pg. 118)
- Follow the instructions to replace the
<div>
and<p>
tags with semantic tags according to this figure.- You will also need to move and add tags as needed, such as with the
<figure>
element and the copyright statement.
- You will also need to move and add tags as needed, such as with the
- Submit only the ch03-proj02.html file to the corresponding Gradescope assignment.
5 - Prep 04: 4.1-4.4, and 4.6-4.7 & 9.1
4.2 - CSS Syntax
4.3 - Location of Styles
4.4 - Selectors
4.6 - The Box Model
4.7 - CSS Text Styling
9.1 - The Document Object Model (DOM)
Read
- FunWebDev Chapter 4.1-4.4, and 4.6-4.7 (skip chapter 4.5 – we will come back to the cascade later).
- FunWebDev Chapter 10.1 (Array Functions). (note this wasn’t here originally for S'24, but was added post hoc in case anyone grabs this for future use)
- FunWebDev Chapter 9.1 (introduction to DOM).
Array Champion 3000
It’s time to work out those array muscles and exercise your JavaScript skills that you’ve been developing!
-
First, open up the MDN web docs for arrays.
-
Next, download the starter HTML file and put it in your
cs343/dev
directory, inside a new folder calledprep4
or something similar. -
Open it through VS Code. You should see a few arrays and eight numbered comments.
-
Your goal is to use different array methods with your own callback functions to solve each of the little exercises and become an array CHAMPION!
- Pro tip: The MDN web docs listed above are your best friend here
- Make sure your variable names to store the results match those provided in the file!
-
When you’re done, submit your
arrays.html
to the corresponding Gradescope assignment.
6 - Prep 05: 4.5, 4.8.2, 7.1, 7.2, and 9.2, 9.3.1, 9.3.2
4.8.2 - CSS Variables
7 - CSS 2: Layout
7.1 - Older Approaches to CSS Layout
9.2 - Modifying the DOM
9.3.1 - Implementing an Event Handler
9.3.2 - Page Loading and the DOM
Read
- FunWebDev Chapter 4.5, 4.8.2 (The Cascade and CSS Variables).
- FunWebDev Chapter 7.1 (CSS Layout).
- FunWebDev Chapter 9.2, 9.3.1, 9.3.2 (Modifying the DOM and Intro to Events)
Activities
We have some fun exercises this week that will let you practice your CSS selector skills and DOM manipulation! Complete both the CSS Diner and the JSChallenger activities.
CSS Diner
Complete levels 1-14 of CSS Diner.
When you’re done, open the menu in the upper-right and submit a screenshot showing you have completed the first 14 levels.
JSChallenger
Complete the following DOM manipulation problems from JSChallenger. Make an account to save your progress.
You do not need to purchase a premium membership (stay free, like a bird 🕊️).
- DOM selector methods
- Events and user interactions
- DOM manipulation
Submit a screenshot of this page, showing that you have completed the challenges in each category.
7 - Prep 06: 7.3-7.4
7.3 - Grid Layout
7.4 - Responsive Design
Read
- FunWebDev Chapter 7.2, 7.3, 7.4 (Flexbox, CSS Grid, and Responsive Design).
Activities
We have some fun exercises this week that will let you practice your CSS layout skills with flexbox and CSS Grid.
- Implement the “Holy Grail” of web layouts as guided by Dr. Johnson and submit a screenshot of the final result running in your web browser.
- Implement the MDN’s “Holy Grail” 🚨 NOTE: the linked MDN page has several interesting examples on it, but we’re linking here specifically only to one section of that page, the one with the heading, “A responsive layout with 1 to 3 fluid columns using grid-template-areas”
- take a screenshot with a viewport width < 500px
- this should show your browser’s URL bar and all, but should look like the left-most third of this image
- take a screenshot with a viewport width >= 500px and < 700px
- this should show your browser’s URL bar and all, but should look like the center third of this image
- take a screenshot with a viewport width >= 700px
- this should show your browser’s URL bar and all, but should look like the right-most third of this image
- take a screenshot with a viewport width < 500px
If you didn’t earlier in the semester, you may find it helpful to now enable rulers in the firefox dev tools.
8 - Prep 07: 5.6-5.7, 8.8.2-8.8.7 & 9.5
5.7 - Validating User Input
8.8.2 - Nested Functions
8.8.7 - Arrow Syntax
9.5 - Forms in JavaScript RegEx
Read
- FunWebDev Chapter 5.6-5.7 (HTML Styling and Validating Forms).
- FunWebDev Chapter 8.8.2-8.8.7 (Functions)
- FunWebDev Chapter 9.5 (Forms in JavaScript)
Git Branching
- https://learngitbranching.js.org/
- do all the exercises in the first 2 sections of the main tab
- do all the exercises in the 1st section of the remote tab
Activity
Your goal is to build a basic form (based on the knowledge from the readings) that will let a user dynamically modify parts of the page.
Please submit your page as a single index.html
file with internal stylesheets and scripts. You may download this template file to help you get started.
The user should be able to specify a number of random images to generate:
And also change the background color:
HTML
In the body
, create the following elements:
- Create a form for specifying the number of images:
- It should have a
label
that says “Number of images:”, - An
input
that only lets you enter numbers, - And a
button
of type"button"
that says “Generate”.
- It should have a
- Create a second form for specifying the background color:
- It should have a
label
that says “Background color:”, - An
input
that lets you pick a color, - And a
button
of type"button"
that says “Change background”.
- It should have a
- Afterwards, create an empty
div
to store your images. - I recommend that you give any element you wish to access via JavaScript a unique
id
!- Like the input fields, the buttons, the div, etc.
JavaScript
In between the script
tags, add JavaScript code so that:
- When the “Generate” button is clicked:
- It should clear all images in the
div
- It should add random images to the
div
based on the number specified in the form - Images should be 200x200 in size
- Images should be from Lorem Picsum:
https://picsum.photos/[WIDTH]/[HEIGHT]?random=[NUMBER]
(replace[WIDTH]
,[HEIGHT]
, and[NUMBER]
) - Each image should be different (hint: change
[NUMBER]
each time you add an image)
- It should clear all images in the
- When the “Change background” button is clicked:
- It sets the background color of body to the color specified in the form
- You may set an inline style to accomplish this (using the
style
property of an element)
9 - Prep 08: 10.1, 10.4.1, and localStorage
10.4.1 - Webstorage API
localStorage HTML Template Tag
Read
- FunWebDev Chapter 10.1 (Array Functions)
- Yes, you’ve seen these before! Now’s a great time to review 😉
- FunWebDev Chapter 10.4.1 (brief overview)
- The Modern JavaScript Tutorial - localStorage
- HTML Template Tag
Activity
For this activity, you will be trying out localStorage
for yourself! Create two html files called save.html
and load.html
.
You may download this template file to help you get started.
save.html
- In a script element, write code to:
- Save your full name to a localStorage entry with the key
fullname
- Save your favorite number to an entry with the key
favnumber
- Save an array of at least three quotes to an entry with the key
quotes
- Hint: you will need to “stringify” the object
- Save your full name to a localStorage entry with the key
- In a script element, write code to:
load.html
- First, add three elements to display the saved data:
- A
div
with the idname-display
- A
div
with the idfavorite-display
- A
ul
with the idquotes-display
- A
- Then, in a script element (at the bottom of the
body
), write code to:- Load the value with the
fullname
key from localStorage and set the firstdiv
’stextContent
to that value - Load the value with the
favnumber
key, add 5 to it, and then set it to the seconddiv
- The value will be loaded as a string. You will need to convert it back to an int.
- Load the value with the
quotes
key and make a new list entry for each quote- Hint: you will need to “parse” the string and convert it back to an object
- Load the value with the
- First, add three elements to display the saved data:
10 - Prep 09: Events and Asynchronicity - 9.3.3-9.4, 10.3
9.4 - Event Types
10.3.0 - Asynchronous Coding with JavaScript
Read
- FunWebDev Chapter 9.3.3-9.4 (inclusive): more on events and events with forms
- FunWebDev Chapter 10.3 (asynchronous programming)
Activity
Complete the “Later Gator” Activity
11 - Prep 10: Location interface, URL API, and the File API's Blobs
Writing and Reading Blobs
Read MDN
- Browser Location API
- URLSearchParams interface, e.g. as obtained from the
window.location
search property - Creating a blob 🤢
- Extracting data from a blob 🤮