web programming intro

38
Web Programming Intro Ynon Perek Tuesday, January 29, 13

Upload: ynon-perek

Post on 12-May-2015

1.878 views

Category:

Technology


0 download

DESCRIPTION

An introductory slide deck for HTML, JavaScript, CSS and web programming

TRANSCRIPT

Page 1: Web Programming Intro

Web Programming IntroYnon Perek

Tuesday, January 29, 13

Page 3: Web Programming Intro

Agenda

The Web Architecture

Hello HTML

Hello CSS

Hello JavaScript

Tuesday, January 29, 13

Page 4: Web Programming Intro

How It All Started

While working at CERN in the 90s, Berners-Lee develops WWW

1991 First web site

1994 Berners-Lee founded the W3C

Tuesday, January 29, 13

Page 5: Web Programming Intro

The Web Architecture

Here It Is

GET data

Client Side Server Side

Tuesday, January 29, 13

Page 6: Web Programming Intro

Server Side

Server side creates the data and returns it to the client

All server-side languages return the same result: HTML

There are many languages...

Tuesday, January 29, 13

Page 7: Web Programming Intro

Client Side

Client side takes the data and renders it on screen

Provides a UX around the data

Can send data back to the server

Browsers: IE, Chrome, Firefox, Safari

Tuesday, January 29, 13

Page 8: Web Programming Intro

The Data

Data is in a format called HTML (Hyper Text Markup Language)

Invented by Tim Berners-Lee

Tuesday, January 29, 13

Page 10: Web Programming Intro

The Data

Tag-based means you need to use the same opening and closing tag

<div>How Do You Annoy A Web Developer ?</span>

Tuesday, January 29, 13

Page 11: Web Programming Intro

Available Tags

Tags (or markup) define the role of their content

Headers:h1, h2, h3, h4, h5, h6

Block Sections: div

Inline Sections: span

Tuesday, January 29, 13

Page 12: Web Programming Intro

DemoInline vs. Block One Two Three (inline)

Container (Block)

Tuesday, January 29, 13

Page 13: Web Programming Intro

Adding Links

Use <a> tag to create a link

<a> is an inline element

Example:

<a href=”http://google.com”>Go To Google</a>

Tuesday, January 29, 13

Page 14: Web Programming Intro

Adding Images

Use <img> tag to create an image

<img> is an inline-block element: It flows it text, but has height and width like a block

alt attribute tells google what’s in the photo

Example:<img src=”http://fc02.deviantart.net/fs21/f/2007/306/d/6/Chibi_turtle_by_blackcattlc.jpg” alt=”Cool Turtle”>

Tuesday, January 29, 13

Page 15: Web Programming Intro

Adding Text

Use <p> tag to wrap text paragraphs

<p> is a block-level element

Adds a newline

Tuesday, January 29, 13

Page 16: Web Programming Intro

Clickable Images

Wrap in <img> in an <a> tag to get an image that is also a link

Demo: images, links and text paragraphs

Tuesday, January 29, 13

Page 17: Web Programming Intro

Lists

HTML has two types of lists: ordered lists marked <ol> and unordered lists marked <ul>

Inside a list block, use <li> to denote items

<ul>, <ol> and <li> are all block elements

Tuesday, January 29, 13

Page 18: Web Programming Intro

Lab

Create an HTML document for your resume

Use correct headers

Add an image

Tuesday, January 29, 13

Page 19: Web Programming Intro

Pages With StyleIntroducing CSS

Tuesday, January 29, 13

Page 20: Web Programming Intro

Cascading Style Sheets

Apply styling rules to elements

Choose an element with a selector

Specify rules using properties

Tuesday, January 29, 13

Page 21: Web Programming Intro

Let’s Start With The Basics

Select all h1 elements

Write text in red

h1 { color: red; }

Tuesday, January 29, 13

Page 22: Web Programming Intro

Let’s Start With The Basics

More CSS styling properties:

background-color, color

font-weight, font-size, font-family, font-style, text-decoration

text-align, line-height

outline

Tuesday, January 29, 13

Page 23: Web Programming Intro

Let’s Start With The Basics

Use #id to find a specific HTML element

h2#main { color: red;}

And in HTML:<h2 id=‘main’>Red</h2>

Tuesday, January 29, 13

Page 24: Web Programming Intro

Let’s Start With The Basics

Use .class to find a set of HTML elements

h2.uppercase { text-transform: uppercase;}

And in HTML:<h2 class=‘uppercase’>Red</h2>

Tuesday, January 29, 13

Page 25: Web Programming Intro

Block Level Properties

Only block (or inline-block) elements have size

width and height are only applicable to block elements

Tuesday, January 29, 13

Page 27: Web Programming Intro

Tools Of The Trade

Development Tools

DOM Libraries

UI Libraries

Tuesday, January 29, 13

Page 28: Web Programming Intro

Development Tools

WebStorm IDE

LiveEdit

Extract inline CSS

Customize Templates

Tuesday, January 29, 13

Page 29: Web Programming Intro

Development Tools

Chrome Developer Tools

Edit HTML and CSS on any page

See Network Activity

Set cache and user agent

Consider Canary

Tuesday, January 29, 13

Page 30: Web Programming Intro

Development Tools

BrowserStack maintain a VM for every browser

Test and see how your app/site works

Tuesday, January 29, 13

Page 31: Web Programming Intro

DOM Libraries

jQuery

YUI

ExtJS Core

Tuesday, January 29, 13

Page 32: Web Programming Intro

UI Libraries

jQuery UI

Kendo UI

YUI

ExtJS

Tuesday, January 29, 13

Page 35: Web Programming Intro

Demo: jQuery UI

A collection of jQuery UI Plugins

Use DOM elements to create widgets

Can integrate with other jQuery Plugins

http://jqueryui.com/datepicker/#inline

Tuesday, January 29, 13

Page 37: Web Programming Intro

Choosing Framework

Use DOM library for maximum control

Use UI library for flexibility AND comfort

Use UI framework for maximum comfort

Tuesday, January 29, 13