Lec 03
Lec 03
Client-side processing
70
70
71
71
1
10/30/2023
72
72
Client/Server Application
73
73
2
10/30/2023
74
74
• In the “fat-client” model, much of the processing is done locally on the client.
75
75
3
10/30/2023
76
76
77
77
4
10/30/2023
78
78
• Like any other client server application, web browsers and servers need a
way to:
1. Locate each other so they can send requests and responses back and
forth
• Uniform resource locator (URL)
2. Communication with one another
• Hypertext transport protocol (HTTP).
79
79
5
10/30/2023
• The global address of the documents and other resources on the web.
• URLs provide a unique name for every page on the web.
80
80
Section of a URL
81
81
6
10/30/2023
What is a port?
82
82
• Html
• Plug-ins
• Scripts
83
83
7
10/30/2023
Html
84
84
<HTMl>
<head>
<title> My Web page</title>
</head>
<body>This is the body of the page </body>
</html>
85
85
8
10/30/2023
Http://www.smallco.com/index.html
86
86
Http://www.smallco.com/index.html
192.22.107.5
87
87
9
10/30/2023
192.22.107.5
port 80
Http://www.smallco.com/index.html
192.22.107.5
88
88
Http://www.smallco.com/index.html
89
89
10
10/30/2023
90
90
HTTP/1.1 200 OK
Content-type: text/html
[contents of index.html]
Http://www.smallco.com/index.html
91
91
11
10/30/2023
• Connection is broken
92
92
HTTP
93
93
12
10/30/2023
HTTP (Cont)
94
94
HTTP request/response
• The browser sends a header to server each time you ask for information
95
95
13
10/30/2023
96
96
HTTP request
97
97
14
10/30/2023
HTTP response
• Start line
• Consists of HTTP version, status code , and description
HTTP / 1.1 200 OK
HTTP /1.1 404 Not Found
• Headers
Content – type: text/html
• Content
98
98
99
99
15
10/30/2023
HTTP/1.1 200 OK
Date: Mon, 15 Sep 2003 21:06:50 GMT
Server: Apache/2.0.40 (Red Hat Linux)
Last-Modified: Tue, 15 Apr 2003 17:28:57 GMT
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Content-length: 107
<html> <head> <title> A Sample HTML file </title> </head> <body> The rest of the document goes here
</body> </html>
100
100
Plug-ins
101
101
16
10/30/2023
Script
• What is a Script?
• A program embedded in an HTML document
• Script can be found multiple places in a document
• There are multiple scripting languages
• JavaScript – far more common and universally interpreted in all
browsers
102
102
103
103
17
10/30/2023
A simple example
104
104
18