reading-notes

These are my reading notes for Code Fellows


Project maintained by taegorov Hosted on GitHub Pages — Theme by mattgraham

Home

Reading Notes Code 201: Day 1

Notes - HTML Chapter 1: “Structure” (pp.12-39)

Notes - HTML Chapter 8: “Extra Markup” (p.176-199)

Notes - HTML Chapter 17: “HTML5 Layout” (pp.428-451)

Notes - HTML Chapter 18: “Process & Design” (pp.452-475)

Site Design Flowchart

x - Home - -
About Articles Visit Shop Contact
History News Location Merch -
Team News Hours Art -

Notes - JS Chapter 1: “The ABC of Programming” (pp.11-52)

NOTE: These notes are taken from my Code 102 course notes. I am the author of the notes, but please be aware that certain text in block quotes is taken from Jon Duckett’s JavaScript & JQuery Book

JavaScript allows you to make web pages more interactive by accessing and modifying the content and markup used in a web page while it is being viewed in a browser

  • Jon Duckett - JavaScript & JQuery

JavaScript essentially allows us to give step-by-step instructions to a browser/computer, kind of like a recipe

Allows users to interact with elements of your website, and allows your website to change depending on certain events/conditions

Common versions of JavaScript that you’ll see on websites:

All of the above rely on the ability to:

Access the content of a page

Modify the content of a page

Program rules or instructions the browser can follow

React to events triggered by the user or browser

Writing a Script

Even if scripts might appear complicated to you now, they’re actually a simple set of instructions

Individual steps of a recipe might need to be broken down further. For example, when making spring rolls, “create peanut sauce” might have its own sub-instructions. Computers need this information

Vocabulary: The words that computers understand

Syntax How you put those words together to create instructions computers can follow

Use flowcharts for the tasks you want the computer to achieve!

<html> is the content layer

{css} is the presentation layer

javascript() is the behavior layer

Progressive Enhancement

All three of these layers work together to make a modern functioning website

Keeping things separate means that pages will still work if certain layers don’t load/run

Basics

Statements

A script is like a step-by-step instruction of how to tie your shoes (or any other set of instructions). Each step (e.g., “cross each lace”) is a statement.

Statements end with a ;

{ and } are the start and end of a code block.

Each statement starts on a new line

Comments

/* Type comments to yourself using this structure */

// you can use the double forward slash for single-line comments //

Like with HTML and CSS, these will help others understand your code better (and help you when you look back at your code months down the road)

Variables

These are just like variables in math or logic, which are “calculated or computed”

Declare a variable like so:

var quantity;

Assign a value to a variable like so:

quantity = 3;

Data Types

Other Notes

You can multiply/add/subtract/etc. variables using just their names, provided you have provided a value (see Data Types) to your variable

Variable Shorthand

There are many ways to de-clutter (or simplify) creating a variable. One option is shown below:

var price = 5;

instead of

var price;

price = 5;