The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software...

30
The World Wide Web

Transcript of The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software...

Page 1: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

The World Wide Web

Page 2: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

2

The World Wide Web

The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.

A Web page is a document that contains or references various kinds of data, such as text, images, graphics, and programs.

Web pages also contain links to other Web pages so that the user can “move around.” It’s these links that turn text documents into hypertext.

Page 3: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

3

The World Wide Web

A Web site is a collection of related Web pages connected by links.

The Internet makes the communication possible, but the Web makes that communication easier, more productive, and more enjoyable.

Page 4: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

4

Web Browser

A browser is a software tool that issues the request for the Web page we want and displays it when it arrives.

We often talk about “visiting” a Web site, as if we were going there.

– In truth, we specify the information we want, and it is brought to us.

Page 5: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

5

Web Browser

Figure 16.2 A browser retrieving a Web page

Page 6: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

6

HTML

Web pages are created (or built) using a language called the Hypertext Markup Language, or HTML.

The term markup language comes from the fact that the primary elements of the language take the form of tags that we insert into a standard text file to annotate the information stored there.

Page 7: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

7

HTML

Page 8: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

8

HTML

Page 9: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

9

HTML

Tags are enclosed in angle brackets.(<. . . >)

Words such as HEAD, TITLE, and BODY are called elements and specify the type of the tag.

Tags are often used in pairs, with a start tag such as <BODY> and a corresponding end tag such as </BODY>.

Page 10: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

10

Structure of an HTML document

<HTML>

<head>

<title>appears in the Title Bar</title>

</head>

<body>

</body>

</HTML>

Page 11: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

11

HTML

The browser determines how the page should be displayed based on the tags.– It ignores the way we format the HTML source

document using carriage returns, extra spaces, and blank lines.

– It takes into account the width and height of the browser window.

When you resize the browser window, the contents of the Web page are reformatted to fit the new size.

Page 12: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

12

Basic Organization in HTML

Several elements are used to organize the display on a web page.– Headings in a document.

There are six predefined heading elements defined in HTML: H1, H2, H3, H4, H5, and H6.

– Paragraphs (<P> . . . </P>) specify text that should be treated as a

separate paragraph.

Page 13: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

13

Examples of HTML Text Formatting

The center tags (<CENTER> . . . </CENTER>) indicate that the enclosed information should be horizontally centered in the browser window.

The B, I, and U elements are used to indicate that the enclosed text should be Bold, Italic, or Underlined, respectively.

Page 14: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

14

Extra Elements of HTML Display

The <HR> tag – inserts a horizontal rule (that is, a line) across the

page

We often have cause to display a list of items.– The UL element creates an unordered list,– the OL element creates an ordered list,– and the LI element distinguishes each list item.

Page 15: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

15

Lists

<ul>

<li>a list item</li>

<li>another list item</li>

<li>and another list item</li>

</ul>

This HTML code will produce…

Page 16: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

16

Lists

…this list in the browser.

Page 17: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

17

Tables

In HTML, a table is comprised of rows of details.

<table> </table> tags surround the table

<tr> </tr> tags surround a row

<td> </td> tags define each detail

Page 18: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

18

Tables

<table border=1> <tr> <td>col1 row1</td> <td>col2 row1</td> </tr> <tr> <td>col1 row2</td> <td>col2 row2</td> </tr></table>

Page 19: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

19

Tables

Page 20: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

20

Tag Attributes

Many tags can contain attributes that indicate additional details about the information or how the enclosed information should be displayed.

For example

<BODY bgcolor=red text=white>

Page 21: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

21

Images

An image can be incorporated into a Web page using the IMG element, which uses the SRC attribute to identify the image to display.

– <IMG SRC = "myPicture.gif">

Page 22: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

22

Links

A link is specified using the element A, which stands for Anchor.

The tag includes an attribute called HREF that specifies the URL of the destination document.

For example:

<A HREF = "http://www.yorku.ca/huma1650"> Networked Imagination Web Site</A>

Page 23: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

23

Interactive Web Pages

When HTML was first developed, there was no way to interact with the text and graphics presented in a Web page.

As users have clamored for a more dynamic web, new technologies were developed to accommodate these requests.

Many of the new ideas were offshoots of the newly developed Java programming language.

Page 24: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

24

Java Applets

A Java applet is a program that is designed to be embedded into an HTML document using the APPLET tag.

<APPLET code="MyApplet.class" width=250 height=150 ></APPLET>

The program is transferred over the Web, along with the text and graphics.

Page 25: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

25

Java Applets

The browser has a built-in interpreter that executes the applet, allowing the user to interact with it.

Consider the difficulties inherent in this situation.– How can we execute a program that was written on

one type of computer to run on possibly many other types of computers?

Page 26: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

26

Java Applets

Java programs are compiled into Bytecode, a low-level representation of a program that is not quite machine code because it’s not specific to any CPU.

A Java interpreter is installed on each user’s machine to translate Bytecode into the machine code for that particular CPU.

This interpreter executes the Bytecode.

Page 27: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

27

Java Applets

Java applets are restricted as to what they can do.– The Java language has a carefully constructed

security model.– An applet, for instance, cannot access any local files

or change any system settings.

Page 28: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

28

Java Server Pages

A Java Server Page, or JSP, is a Web page that has JSP scriptlets embedded in it.

A scriptlet is a small piece of executable code intertwined among regular HTML content.

A JSP scriptlet is encased in special tags beginning with <% and ending with %>.

Imagine JSP scriptlets as having the expressive power of a full programming language.

Page 29: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

29

Java Server Pages

Page 30: The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.

30

Java Server Pages

Note that JSPs are executed on the server side where the Web page resides.

By the time it arrives at your computer, all active processing has taken place, producing a static (though dynamically created) Web page.

JSPs are particularly good for coordinating the interaction between a Web page and an underlying database.