Professional Documents
Culture Documents
Week 2 - T-2
Week 2 - T-2
Week 2 - T-2
Languages and
Technologies
Bruno Veloso
brunov@upt.pt
23/09/2018
IMP.GE.190.0
2
IMP.GE.190.0
3
IMP.GE.190.0
4
IMP.GE.190.0
5
•Firefox 62+
•Chrome 68+
•Edge
•Internet Explorer 11
•It’s mandatory to have your final project work correctly in IE, Firefox,
Chrome and Edge because together they represent 80 % of the
market share.
•One of these is enough for class assignments.
IMP.GE.190.0
6
Applications != Websites
Website
•Main activity: content consumption (example: news)
Application
•Main activity: Interaction (example: SIUPT)
IMP.GE.190.0
7
IMP.GE.190.0
8
HTTP protocol
Simplified protocol
•Session ::= request response
•Request ::= requestLine header + [body]
•RequestLine ::= method path
•Response ::= status header + [body]
What headers contain
•Info about request or response, or about body
What body contains
•In request: form data, uploaded files
•In response: resource
IMP.GE.190.0
10
IMP.GE.190.0
11
Verbs
•GET
•POST
•PUT
•DELETE
IMP.GE.190.0
12
IMP.GE.190.0
13
Headers (request/response)
IMP.GE.190.0
14
IMP.GE.190.0
15
What is it?
•Created in the early 90’s of the 20th century, by the physicist Sir Tim
Berners-Lee as a new format to share information and scientific articles
on the Internet.
•HyperText: Means it’s possible to navigate from one article to another
through a connection.
•Markup Language: Beyond the content, HTML describes semantically
how each piece of content relates to the rest.
•HTML is pure text and can be written in any text editor.
IMP.GE.190.0
16
IMP.GE.190.0
17
Link example
IMP.GE.190.0
18
IMP.GE.190.0
19
IMP.GE.190.0
20
IMP.GE.190.0
21
IMP.GE.190.0
22
Tree representation
My dog
p img
Is really
ugly
IMP.GE.190.0
23
My
dog
p A
img
Is really
IMP.GE.190.0
ugly
24
IMP.GE.190.0
25
Historical perspective I
•HTML v4.0.x
• A lot of presentation functionality copied to CSS
(Cascading Style Sheets).
• Some functionality was removed.
•HTML v5
• Virtually all presentation functionality moved to CSS.
• Much functionality was removed.
• A lot of semantic functionality was added.
IMP.GE.190.0
26
•“The World Wide Web's markup language has always been HTML.
HTML was primarily designed as a language for semantically
describing scientific documents, although its general design and
adaptations over the years have enabled it to be used to describe a
number of other types of documents.
•The main area that has not been adequately addressed by HTML is a
vague subject referred to as Web Applications. [The HTML5]
specification attempts to rectify this, while at the same time updating
the HTML specifications to address issues raised in the past few
years.”
IMP.GE.190.0
27
Page elements
•An HTML page, beyond its content and respective markup, needs a
framework.
IMP.GE.190.0
28
DOCTYPE
•The HTML page must always begin with the following line of code:
<!doctype html>
•This tells browsers that the following text should be interpreted as standards-
based HTML (informally as HTML 5).
IMP.GE.190.0
29
Root
•After the doctype, the page should have the root element that contains ALL
the rest of the html:
<!doctype html>
<html>
…
</html>
IMP.GE.190.0
30
<html>
<head>
…
</head>
<body>
…
</body>
</html>
IMP.GE.190.0
31
<!DOCTYPE html>
<html> Mandatory
<head>
<meta charset='utf-8' />
<title>Hello, World!</title>
</head>
<body>
Hello, World!
</body>
</html>
IMP.GE.190.0
32
HTML5 Resources
•Tutorials
• http://diveintohtml5.info/
• http://developers.whatwg.org/
• http://www.html5doctor.com/
• http://mathiasbynens.be/notes/html5-levels
• http://www.html5rocks.com/
•Tools:
• http://validator.w3.org/
IMP.GE.190.0
33
Exercise 1
IMP.GE.190.0
34
Exercise 2
IMP.GE.190.0
35
IMP.GE.190.0