insert screenshot of empty chrome tab
browser w/ Facebook ==? magnets
- What You Need to Know as a Web Developer
- Vocabulary:
- Page Markup
- Clients and Servers
- Requests and Responses
- Browser:
- Content
- Presentation
- Interaction
- Server:
- Routing
- Controllers
- Databases
- Templates
- Not sure what shoudl go here
- Page Markup
- Client-Server
- Request-Response
-
Content: HTML
- Page structure and content.
-
Presentation: CSS
- How it looks
-
Interaction: Javascript
- Change things!
-
"Front End"
- Website with many users
- 1 server - many clients
- Content can change per client
- How does your browser (client) communicate with the website (server)?
- Browser asks for a resource from the server
- http://www.example.com/about.html Host: www.example.com GET /about.html HTTP/1.1
- Server sends a response
- 200 OK
- 304 Not Modified
- 404 Not Found
- 500 Server Error
- HTML/image/whatever
- Browser then sends more requests for images, stylesheets, javascript, etc.
-
Diving Deeper, this time on your machine.
-
I want to visit. Where do I begin?
- Declarative, not Instructive
- Java/C/etc. says "do this, then this" document.drawString("Welcome to Example.com", myfont, size, ...)
- HTML says "this needs to be displayed, the browser can work it out"
- Takes the "plan" and figures out which pixels to turn on.
- Hypertext Markup Language
- Tags with content and attributes
- Tags Nested within Tags
- Cascading Style Sheets
- Assign visual properties to elements.
- Browser still decides how to display it.
- Syntax tied to the "id" and "class" attributes. #container { width: 960px; background-color: white; } .section { border: 1px solid #ccc; background-color: #eee; } p { font-size: 16px; color: #224; }
- Number/Hash/Pound is for "id"
- Dot/Period is for "class"
- Unprefixed for Tag names
- Assign properties to elements nested within others. .section h2 { font-weight: bold; }
-
Normal language that interacts with the HTML and CSS.
-
Runs "in the browser"
-
Similar to Java, but really more like Scheme footer = document.findElementById("footer");
footer.textContent; => "Email cwdgosu@gmail.com for more information."
footer.onclick = function(){ alert("Clicked the footer!"); };
- Diving Deeper, this time on the Server!
- Recieved a request. What now?