Hi again!

We'll start at 9:45.

What we did yesterday

  • wrote our website content in HTML
  • edited our website styles using CSS
  • hosted our website on the Web using GitHub

Today's plan

  • deploying your website part two
  • a basic introduction to programming
  • lunch
  • "office hours"

Deployment

  • To be publicly accessible, your website needs to be hosted somewhere on the Internet.
  • We're using a feature of GitHub called GitHub Pages to host our website.

Deployment

  • Changing the site on your machine will not change the site on the internet.
  • You will need to edit your site locally (on your computer), and then update the files that are hosted on GitHub.

</deployment>

Programming

How to get a computer to do exactly what you want tell it to do.

There are a lot of programming languages out there

We're going to talk about JavaScript.

Basic Javascript Syntax

alert("Hello, world");
  • alert is a function that creates a popup with some text. We use the parentheses after it to call the function with an argument.
  • In JavaScript, all text that isn't in "quotes" is interpreted as instructions for the computer.
  • So we need to put all text that isn't code in quotes.

Basic Javascript Syntax

function sayHello(name) {
    alert("Hello, " + name);
}

We can also make our own functions.

function sayHello(name, day) {
    alert("Hello, " + name + " isn't it a lovely " + day + "?");
}

They can take multiple arguments

Basic Javascript Syntax

function sayHello(name, day) {
    var greeting = "Hello, " + name + " isn't it a lovely " + day + "?";
    alert(greeting);
}

You can use variables to store data with =

Basic JavaScript Syntax

You can use if statements and double-equals to check if something meets a condition.

function sayHello(name, day) {
    var greeting = "Hello, " + name + " isn't it a lovely " + day + "?";

    if (day == "Sunday") {
        greeting = "I'm going back to bed.";
    } else if (name == "Barry") {
        greeting = "Why hello, President Glassner!";
    }
  
    alert(greeting);
}

Demo!

http://github.com/qrohlf/jsconsole

bootcamp

By Quinn Rohlf

bootcamp

  • 1,220