Notes for CMPT 165, Fall 2017 (Surrey)¶
For due dates, quizzes, announcements, and other course information please see Canvas.
Notes for Module 3: JavaScript¶
- Read: introduction to JavaScript
- Read: writing basic JavaScript programs
- Download:
jQuery starter web site
- Download:
p5.js starter web site
- Bookmark:
- Read: Introduction to p5.js
- Read: for-loops
- Review:
JavaScript review questions (pdf)
Notes for Module 2: CSS¶
Introduction to CSS¶
- Bookmark: CSS reference; A different CSS reference
- Read: How CSS Works
- Download:
simple (internal) CSS styles example
;simple (external) CSS styles example
- Read: CSS Syntax
- Read: Simple Selectors, Attribiute Selectors, Pseudo-classes and pseudo-elements, Combinators and multiple selectors
- Read: CSS values and units
- View:
all 16,777,216 different 24-bit colors in a single 4096x4096 image (36MB)
; each pixel is a different color, and the pattern of colors is just a side-effect of the order in which they were placed - View: an HTML table showing all 256 grayscale values and color codes
- Optional extra: Play with the Scratch programming environment. It’s a nice break from CSS, and gives you a small taste of programming (which we will do later in the course using JavaScript).
- Read: Fonts
- Read: Cascade and Inheritance
- Try: CSS specificity calculator
- Read: The CSS Box Model
- Read: CSS Layout
- Memorize: ctrl-shift-C in Chrome to open the Chrome web development console
- Examine: other websites, such as Walmart.ca or CBC News to get ideas for website design
- Remember: the C.R.A.P. rules of thumb for good design: constrast, repetition, alignment, proximity.
The HTML in-class exam will be on topics below this line! Here is the
Module 1 Review presentation (pdf)
(quiz answers (pdf)
).
You don’t need to know anything about public key cryptography, but you should know the essential difference between HTTP and HTTPS.
Notes for Module 1: HTML¶
History, and Basics of the Internet and Web¶
- Read:
Brief history of computers, the Internet, and web (PowerPoint)
- Watch: A UNIVAC TV commercial from the 1950s
- Read: How the Web works
- Browse: the very first website
- Concepts to know: client/server network, TCP/IP, DNS, HTTP, packets,
Internet vs. web,
ping
-ing a server, IP address format, URLs, etc.
Introduction to HTML¶
- Read: Getting started with HTML
- Bookmark: HTML tag reference
- Memorize: ctrl-O in Chrome to open an HTML file, ctrl-U in Chrome to view the source for any web page
- Download:
intro_html_website.zip
- Potato:
spud.gif
- Watch: How a Blind Person Uses a Computer (shows the importance of
alt
text for the<img>
tag!) - Read: Designing accessible websites so they can be more easily used by people with disabilities. All web designers should take some time to learn about website accessibility.
- Things to know: elements, begin tags, end tags, basic structure of elements on a web page, how to display images on a web page, image alt text, common folder structure, basic Chrome short-cut commands, etc.
The Structure of a Web Page¶
- Read: What’s in the head? Metadata in HTML
- Download:
special_characters.zip
(examples of special characters) - Memorize: you should know these special character codes
<
is the less-than symbol<
>
is the greater-than symbol>
&
is the ampersand symbol&
is a non-breaking space
- Bookmark: list of special HTML characters
- Download:
basic_page_template.zip
(use this as the start of your web pages) - Bookmark: a favicon generator (there are many others!)
- Concepts to know: metadata, high-level structure of HTML 5 web pages, purpose of special characters, the most common special characters, etc.
Structure, Lists, and Other Tags¶
- Read: HTML Text Fundamentals
- Download:
basic_tags_website.zip
(examples of many HTML tags, with lots of description) - Concepts to know: ordered lists, numbered lists, list within lists, common list attributes, etc.
- Lecture quiz 1:
lecture quiz 1 (pdf)
(pdf with solutions
)
URLs and Hyperlinks¶
- Read: Creating Hyperlinks
- Download:
links_website.zip
(examples of URLs and hyperlinks, with lots of description) - Concepts to know: structure of
a
elements, links to external pages, links to internal pages, links within a document, absolute links, relative links, etc.
Tables¶
Read: Basic Tables
Read: Advanced Tables
Download:
table_website.zip
(examples of URLs and hyperlinks, with lots of description)Install: If you’re using Sublime 3 as your text editor, then we recommend you install the HTML-CSS-JS package as follows:
In Sublime 3, type ctrl-shift-P, type “install”, and then select Package Control: Install Package. This should take a few seconds to download and install HTML-CSS-JS Prettify.
Test that it works by right-clicking in Sublime 3 and verify that HTML/CSS/JS Prettify is in the menu. Select Prettify Code to ensure it works.
It’s possible that this could fail to work if Node.js (a version of the JavaScript programming language) isn’t installed on your computer. Some computers come with Node.js installed, and some don’t. So if Sublime tells you you need to install Node.js, download the Node.js installer for your computer and install Node.js.
Optional extra: If you write a lot of HTML by hand, more than you’ll be writing for this course, then you may want to look into using a package such as Emmet. Emmet provides many more shortcuts for quickly writing HTML.
- Concepts to know: purpose of tables, table element, table row elements,
table cell elements, table header cells, purpose of
colgroup
andcol
elements, the table elementscaption
,thead
,tbody
, andtfoot
, importance of well-formatted HTML, etc. - Optional Extra: two entertaining movies where codes and secrets play a major part are Sneakers and Dr. Strangelove
(Google) Search¶
- Try: a few interesting Google searches, such as “do a barrel roll”, “Google in 1998”, “what’s the weather?”, “translate potato to German”, “how’s traffic?”, “what’s 345 times 87”, “female astronauts”, ...
- Review:
lecture slides about Google search (pdf)
- Review: The course marking scheme is on Canvas under the “Pages” link. Make sure you understand how your exam marks will be determined!
- Watch: a 4min video on how Google use it’s knowledge graph to give featured answers (that can sometimes go wrong)
- Concepts to know: the basic history of Google, spiders (crawlers), PageRank, robots.txt, sitemaps, white hat SEO, black hat SEO, search word- analysis techniques, techniques for presenting search results, etc.