reading-notes

Aloysious' Codefellows Reading Notes

View the Project on GitHub

Code 201 Reading Notes

Class 4

Class 1 Instructor’s Repo

<== Previous Lesson Next Lesson ==>

<== Home 🏠

  1. CSS MASTER CHEAT
  2. learnlayout.com practical entry point into layout
  3. CSS Zen Garden allows you to practice CSS styling and see how others have styled the same HTML code.
  4. Centering in CSS has some helpful tips for centering content horizontally and vertically.
  5. Floats in CSS as explained by riding an escalator.
  6. CSS Snapshot 2020
  7. CSS EXAMPLES - JavaTpoint

URL | Uniform Resource Locator | Relative URL

url photo codecamp images

Uniform Resource Locator navigates to a website outside of your own

Relative URL navigates user to anothe page within your websites directory

  1. You can create links to open email programs.
  2. You can create links to open a new window. (It is a good measure to include a disclaimer which informs the user that they will be directed elsewhere or may need pop up blocker to be disabled)
  3. You can use the id attribute to target elements within a page that can e linked to.
  4. emailto: <a href="mailto:aloysious@example.org">Email Aloysious</a>
  5. target <a href="http://imdb.com" target="_blank">Internet Movie Database</a> (Opens in a new window)
  6. id (Link at top of page)<h1 id="top>Film Making Terms</h1>
  7. id (Link at bottom of page)<p><a href="#top">Film Making Terms</a></p>

Layout [Duckett HTML] (pp.358-404)

Positioning Schemes

Visual formatting model

SELECTORS

PROPERTIES

Functions, Methods, and Objects [Duckett JS] (pp.86-99 ONLY)

JavaScript Function Syntax

The code to be executed, by the function, is placed inside curly brackets: {}

function name(parameter1, parameter2, parameter3) {

// code to be executed

}

Function parameters are listed inside the parentheses () in the function definition.

Function arguments are the values received by the function when it is invoked.

Inside the function, the arguments (the parameters) behave as local variables.

A Function is much the same as a Procedure or a Subroutine, in other programming languages.

Function Invocation

The code inside the function will execute when “something” invokes (calls) the function:

Function Return

When JavaScript reaches a return statement, the function will stop executing.

If the function was invoked from a statement, JavaScript will “return” to execute the code after the invoking statement.

Functions often compute a return value. The return value is “returned” back to the “caller”:

EXAMPLE

Calculate the product of two numbers, and return the result:

var x = myFunction(4, 3); // Function is called, return value will end up in x

function myFunction(a, b) {

return a *b; // Function returns the product of a and b

}

The result in x will be:

12 Notes above W3Schools Functions

The JavaScript this Keyword

The JavaScript this keyword refers to the object it belongs to.

It has different values depending on where it is used:

In a method, this refers to the owner object.

Alone, this refers to the global object.

In a function, this refers to the global object.

In a function, in strict mode, this is undefined.

In an event, this refers to the element that received the event.

Methods like call(), and apply() can refer this to any object. this W3Schools

Pair Programming

The Driver is the programmer who is typing and the only one whose hands are on the keyboard. Handling the “mechanics” of coding, the Driver manages the text editor, switching files, version control, and—of course writing—code. The Navigator uses their words to guide the Driver but does not provide any direct input to the computer.

The Navigator thinks about the big picture, what comes next, how an algorithm might be converted in to code, while scanning for typos or bugs. The Navigator might also utilize their computer as a second screen to look up solutions and documentation, but should not be writing any code.

Reading

From the Duckett HTML book:

From the Duckett JS book:

layout of webpages

<== Previous Lesson Next Lesson ==>

<== Home 🏠