WT Lecture Notes 01
WT Lecture Notes 01
Contents
Introduction to Web Technology.....................................................................................................3
Introduction to Internet................................................................................................................3
History of Internet........................................................................................................................3
World Wide Web.........................................................................................................................4
Client/Server model.....................................................................................................................5
Three-tier Client Server Architecture.......................................................................................5
Peer to Peer (P2P).....................................................................................................................6
Internet and World Wide Web (www).....................................................................................6
Uniform Resource Identifier (URI)..........................................................................................7
Uniform Resource Locator (URL)...........................................................................................7
Browsers.......................................................................................................................................8
Hypertext Transport (HTTP) Protocol.............................................................................................8
Process of http..............................................................................................................................9
HTTP Request and Response.....................................................................................................10
Request Line...........................................................................................................................11
Status Line..............................................................................................................................11
HTML............................................................................................................................................12
A Simple HTML Document......................................................................................................12
HTML Tag.................................................................................................................................13
Exercise..................................................................................................................................14
HTML FORM............................................................................................................................14
Exercise..................................................................................................................................15
XML..............................................................................................................................................16
XHTML.........................................................................................................................................17
DOM..............................................................................................................................................18
DHTML.........................................................................................................................................19
References......................................................................................................................................19
P a g e 1 | 21
Web Technologies (CSC 3222)
P a g e 2 | 21
Web Technologies (CSC 3222)
Introduction to Internet
A global computer network providing a variety of information and communication facilities,
consisting of interconnected networks using standardized communication protocols. "the guide is
also available on the Internet" The Internet is the global system of interconnected computer
networks that use the Internet protocol suite (TCP/IP) to link devices worldwide. It is a network
of networks that consists of private, public, academic, business, and government networks of
local to global scope, linked by a broad array of electronic, wireless, and optical networking
technologies. The Internet carries a vast range of information resources and services.
History of Internet
This marvelous tool has quite a history that holds its roots in the cold war scenario. A need was
realized to connect the top universities of the United States so that they can share all the research
data without having too much of a time lag. This attempt was a result of Advanced Research
Projects Agency (ARPA) which was formed at the end of 1950s just after the Russians had
climbed the space era with the launch of Sputnik. After the ARPA got success in 1969, it didn‘t
take the experts long to understand that how much potential can this interconnection tool have. In
1971 Ray Tomlinson made a system to send electronic mail. This was a big step in the making as
these opened gateways for remote computer accessing i.e. telnet.
During all this time, rigorous paper work was being done in all the elite research institutions.
From giving every computer an address to setting out the rules, everything was getting penned
down. 1973 saw the preparations for the vital TCP/IP and Ethernet services. At the end of 1970s,
Usenet groups had surfaced up. By the time the 80s had started, IBM came up with its PC based
on Intel 8088 processor which was widely used by students and universities for it solved the
purpose of easy computing. By 1982, the Defense Agencies made the TCP/IP compulsory and
the term ―internet‖ was coined. The domain name services arrived in the year 1984 which is
also the time around which various internets based marked their debut. A worm, or a rust the
computers, attacked in 1988 and disabled over 10% of the computer systems all over the world.
While most of the researchers regarded it as an opportunity to enhance computing as it was still
in its juvenile phase, quite a number of computer companies became interested in dissecting the
cores of the malware which resulted to the formation Computer Emergency Rescue Team
(CERT). Soon after the world got over with the computer worm, World Wide Web came into
existence. Discovered by Tim Berners-Lee, World Wide Web was seen as a service to connect
documents in websites using hyperlinks.
P a g e 3 | 21
Web Technologies (CSC 3222)
P a g e 4 | 21
Web Technologies (CSC 3222)
Client/Server model
Client Server Architecture is a computing model in which the server hosts, delivers and
manages most of the resources and services to be consumed by the client. This type of
architecture has one or more client computers connected to a central server over a network or
internet connection. This system shares computing resources.
Client/server architecture is also known as a networking computing model or client/server
network because all the requests and services are delivered over a network.
P a g e 5 | 21
Web Technologies (CSC 3222)
• WWW is one of the services that run on the Internet. It is a collection of interconnected
documents and other resources, linked by hyperlinks and URLs. An application running
on the Internet.
• Viewing a web page on the World Wide Web normally begins
• typing the URL of the page into a web browser,
• Following a hyperlink to that page or resource.
• The web browser then initiates a series of communication messages, behind the scenes, in
order to fetch and display it.
• First, the server-name portion of the URL is resolved into an IP address using the global,
distributed Internet database known as the Domain Name System (DNS).
• The browser then requests the resource by sending an HTTP request to the Web server at
that particular address.
• While receiving these files from the web server, browsers may progressively render the
page onto the screen as specified by its HTML, Cascading Style Sheets (CSS), or other
page composition languages.
• Uniform Resource Identifier (URI)- a universal system for referencing resources on the
Internet, such as hypertext documents and images.
• HyperText Transfer Protocol (HTTP)- how the browser and server authenticate each
other.
Browsers
WWW Clients or "Browser": The program you use to access the WWW is known as a browser
because it "browses" the WWW and requests these hypertext documents. Browsers can be
graphical, allows seeing and hearing the graphics and audio; text-only browsers (i.e., those with
no sound or graphics capability) are also available. All of these programs understand http and
other Internet protocols such as FTP, gopher, mail, and news, making the WWW a kind of "one
stop shopping" for Internet users.
Process of http
Whenever you issue a URL from your browser to get a web resource using HTTP,
e.g. http://www.nowhere123.com/index.html , the browser turns the URL into a request
message and sends it to the HTTP server. The HTTP server interprets the request message, and
returns you an appropriate response message, which is either the resource you requested or an
error message. This process is illustrated below:
A URL (Uniform Resource Locator) is used to uniquely identify a resource over the web. URL
has the following syntax:
Protocol://hostname:port/path-and-file-name
P a g e 9 | 21
Web Technologies (CSC 3222)
P a g e 10 | 21
Web Technologies (CSC 3222)
Request Line
The first line of the header is called the request line, followed by optional request headers.
Examples of request line are:
GET: A client can use the GET request to get a web resource from the server.
GET /test.html HTTP/1.1
POST: Used to post data up to the web server. HTML form uses POST request.
POST /index.html HTTP/1.1
PUT: Ask the server to store the data.
PUT /index.html HTTP/1.1
DELETE: Ask the server to delete the data.
DELETE /index.html HTTP/1.1
Status Line
The first line is called the status line, followed by optional response header(s).
Examples of status line are:
HTTP/1.1 200 OK
HTTP/1.0 404 Not Found
HTTP/1.1 403 Forbidden
P a g e 11 | 21
Web Technologies (CSC 3222)
HTML
HTML stands for Hyper Text Markup Language
HTML describes the structure of a Web page
HTML consists of a series of elements
HTML elements tell the browser how to display the content
HTML elements are represented by tags
HTML tags label pieces of content such as ”heading”,
”paragraph”, ”table”, and so on
Browsers do not display the HTML tags, but use them to render the content of the page
</body>
</html>
P a g e 12 | 21
Web Technologies (CSC 3222)
HTML Tag
HTML Headings
<h1>Heading 1</h1>
---------upto-------
<h6>Heading 6</h6>
HTML Paragraphs
<p>This is a paragraph.</p>
HTML Links
<a href="https://www.w3schools.com/html/">Visit our HTML tutorial</a>
<a href="html_images.html">HTML Images</a>
HTML Images
<img src="pic_trulli.jpg" alt="Italian Trulli">
HTML Tables
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
</table>
HTML Lists
<ul style="list-style-type:disc;">
<li>Coffee</li>
<li>Tea</li>
</ul>
P a g e 13 | 21
Web Technologies (CSC 3222)
Exercise
1. Design a personal CV/your web page using html elements.
HTML FORM
An HTML form is used to collect user input. The user input can then be sent to a server
for processing.
The HTML <form> element defines a form that is used to collect user input.
The <input> element is the most important form element.
The <input> element is displayed in several ways, depending on the type attribute.
<input type="button">
<input type="checkbox">
<input type="date">
<input type="email">
<input type="file">
<input type="hidden">
<input type="image">
<input type="password">
<input type="radio">
<input type="range">
<input type="reset">
<input type="submit">
The Action Attribute: The action attribute defines the action to be performed when the
form is submitted. If the action attribute is omitted, the action is set to the current page.
Method Attribute: The method attribute specifies the HTTP method (GET or POST)
to be used when submitting the form data.
<form action="/action_page.php" method="get">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br>
<label for="email">Email:</label>
<input type="text" id="email" name="email"><br>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label><br>
<input type="radio" id="female" name="gender" value="female>
<label for="female">Female</label><br>
<input type="submit" value="Submit">
<input type="reset">
</form>
P a g e 14 | 21
Web Technologies (CSC 3222)
Exercise
1. Design a login form, change password form and registration form as follows:
P a g e 15 | 21
Web Technologies (CSC 3222)
XML
XML stands for eXtensible Markup Language.
XML was designed to store and transport data.
XML was designed to be both human- and machine-readable.
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Save the file name.xml
XML was designed to carry data, not to display data
XML tags are not predefined. You must define your own tags
XML is designed to be self-descriptive.
XML is a W3C Recommendation
Maybe it is a little hard to understand, but XML does not DO anything. XML was created
to structure, store, and transport information.
P a g e 16 | 21
Web Technologies (CSC 3222)
XML is the most common tool for data transmissions between all sorts of applications.
XML Documents Form a Tree Structure
XML documents must contain a root element. This element is "the parent" of all other
elements.
The elements in an XML document form a document tree.
The tree starts at the root and branches to the lowest level of the tree.
All elements can have sub elements (child elements)
XHTML
XHTML is a stricter, more XML-based version of HTML.
XHTML stands for EXtensible HyperText Markup Language
XHTML is a stricter, more XML-based version of HTML
XHTML is HTML defined as an XML application
All XHTML elements must be closed.
XHTML elements must be properly nested
<b><i>bold and italic</b></i> is wrong
XHTML documents must be well-formed
XML is a markup language where everything must be marked up correctly, which results
in "well-formed" documents. Today's market consists of different browser technologies,
some browsers run on computers, and some browsers run on mobile phones or other
small devices. The last-mentioned do not have the resources or power to interpret a "bad"
markup language.
Combining the strengths of HTML and XML, W3C recommended a markup language i.e
XHTML.
P a g e 17 | 21
Web Technologies (CSC 3222)
DOM
DOM a standard for accessing documents like XML and HTML
"The W3C Document Object Model (DOM) is a platform and language-neutral interface
that allows programs and scripts to dynamically access and update the content, structure,
and style of a document."
The DOM is separated into 3 different parts / levels:
Core DOM - standard model for any structured document
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
The DOM defines the objects and properties of all document elements, and the methods
(interface) to access them.
When you want to access HTML elements with JavaScript, you have to find the elements first.
There are a couple of ways to do this:
Finding HTML elements by id
Finding HTML elements by tag name
Finding HTML elements by class name
Finding HTML elements by CSS selectors
Finding HTML elements by HTML object collections.
P a g e 18 | 21
Web Technologies (CSC 3222)
DHTML
DHTML stands for Dynamic HTML, it is totally different from HTML.
The DHTML is based on the properties of the HTML, JavaScript, CSS, and DOM
(Document Object Model which is used to access individual elements of a document)
which helps in making dynamic content.
The DHTML make use of Dynamic object model to make changes in settings and also in
properties and methods.
DHTML Example(Changing HTML Content)
The HTML document above contains an <h1> element with id="id01"
We use the HTML DOM to get the element with id="id01"
A JavaScript changes the content (innerHTML) of that element to "New Heading"
<!DOCTYPE html>
<html>
<body>
<h1 id="id01">Old Heading</h1>
<script>
var element = document.getElementById("id01");
element.innerHTML = "New Heading";
</script>
</body>
</html>
The following example changes the style of a <p> element:
<html>
<body>
<p id="p2">Hello World!</p>
<script>
document.getElementById("p2").style.color = "blue";
</script>
<p>The paragraph above was changed by a script.</p>
</body>
</html>
References
[1] https://www.ntu.edu.sg/home/ehchua/programming/webprogramming/HTTP_Basics.html
[2] https://www.w3schools.com/html/default.asp
[3]https://w3schools.sinsixx.com/dhtml/dhtml_javascript.asp.htm
P a g e 19 | 21