Download presentation
Presentation is loading. Please wait.
Published byNoel nolan Tagg Modified over 9 years ago
1
Chapter 16 The World Wide Web
2
2 The World Wide Web (Web) is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information. The Internet makes the communication possible, but the Web makes that communication easier, more productive, and more enjoyable.
3
3 The World Wide Web 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. A Web site is a collection of related Web pages, connected by links.
4
4 Web Browser A browser is a software tool that acts as a network client. It issues requests for the Web pages we want and displays them when they arrive. We often talk about “visiting” a Web site, as if we were going there. In truth, we request the information we want, and it is served to us.
5
5 Web Browser
6
6 URLs The request sent by the browser is called a Uniform Resource Locator, or URL. It uniquely identifies the page you want among all of the files stored anywhere in the world accessible to the Internet. This identification contains the file’s name and location, as well as the set of rules required to transfer it.
7
7 URLs Every URL has four parts: I. protocol http is the protocol used to transfer Web pages II. hostname III. path IV. filename E.g. http://www.eecs.yorku.ca/course/1520alt/index.html I.II.III.IV.
8
8 Search Engines Search Engine: A website to find other websites. Examples include: AIO Search, Ask Jeeves, Bing, Blippex, Google, kifi, Recusive, Omni, Search All, Search Me, Spotify, Yahoo Each maintains a database of information, including an index of keywords and URLs that feature them. The dBase is maintained by “spider bots” that “crawl” the web, examining more than 1 trillion (1,000,000,000,000) unique URLs.
9
Search Engines When you enter keywords, the search engine produces a list of links to potentially useful sites. Of course, ‘useful’ means different things! There are two approaches to searching: Keyword searches Concept-based searches
10
10 Instant Messaging Instant messaging (IM): An application that allows people to send and receive messages in real time. Both sender and receiver must have an IM app running. Most IM applications use a proprietary protocol that dictates the precise format and structure of the messages that are sent across the network to the receiver. Instant messages are not secure! Except BBM
11
Blogs Short for weblog Publishing mechanism Use has evolved “citizen journalism”
12
12 Cookies Cookie: A small text file that a web server stores on your local computer’s hard disk. A cookie contains information about your visit to the site. Cookies can be used to determine number of unique visitors to the site, to customize the site for your future visits, to implement shopping carts that can be maintained from visit to visit. Cookies are not dangerous!
13
13 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.
14
HTML Since web pages are standard text files they can be created with any text editor. They can also be transferred vary quickly. The files are saved with the file extension.html (or.htm) so browsers will apply the appropriate rules to the text.
15
HTML – a brief history 1980 - Tim Berners-Lee began development of HTML at CERN.CERN 1991 - First specification for HTML published. 1995 - Request for Comments 1866 specifies HTML 2.0.Request for Comments 1996 - World Wide Web Consortium (W3C) maintains specifications for HTML.World Wide Web Consortium 1999 - HTML 4.01 published. 2004 - development began on HTML5.
16
HTML – the future 2011 - HTML5 standard released HTML5 responds to the regret of web designers over the conflation of Structure and Presentation in HTML. It looks very promising for serious developers, providing a streamlined tag system and support for dynamic content.
17
XHTML – the present HTML5 is not yet widely supported by browsers, but the important shift in design philosophy is embodied in XHTML. The current style is to use XHTML to specify Structure, and Cascading Style Sheets (CSS) to specify Presentation.
18
What Is XHTML? XHTML - eXtensible HyperText Markup Language very similar to HTML 4.01 stricter and cleaner HTML defined as an XML application a W3C Recommendation of January 2000January 2000 supported by all major browsers
19
Structure of an XHTML document An XHTML document consists of 3 main parts: the declaration the section
20
20 Structure of an XHTML document appears in the Title Bar …
21
XHTML The declaration is mandatory in XHTML. This declaration refers to a Document Type Definition (DTD) which specifies the rules for the markup language, so that the browsers render the content correctly. For example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22
XHTML - Different Doctypes XHTML 1.0 Strict This DTD contains all HTML elements and attributes, but does NOT INCLUDE presentational or deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. XHTML 1.0 Transitional This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. XHTML 1.0 Frameset This DTD is equal to XHTML 1.0 Transitional, but allows the use of Framesets. XHTML 1.1 This DTD is equal to XHTML 1.0 Strict, but allows you to add modules (for example to provide ruby support for East-Asian languages).
23
XHTML Some important differences between HTML and XHTML: XHTML elements must be properly nested. XHTML elements must always be closed. XHTML elements must be in lowercase. XHTML documents must have one root element.
24
24 XHTML - Tags A tag consists of a keyword enclosed in angle brackets. ( ) Tags are most often used in pairs, with a start tag such as and an end tag such as surrounding the text to which they apply. A tag pair, along with its enclosed text, is called an element.
25
25 A sample document This is the file basic.txt basic.txt It contains “raw” text and XHTML mark-ups. Tags are. CSE 1520alt Welcome to the Website for CSE 1520alt This is our first foray onto the World Wide Web. We are trying to learn how to create pages that can become part of the WWW. We hope to learn about elements of Structure, including: - headings - paragraphs - tables
26
26 XHTML The same file displayed in a browser.
27
27 XHTML Note that the browser determines how the page should be displayed based on the tags. It ignores the way we format the XHTML source document. Tabs, carriage returns, extra spaces, and blank lines are called “whitespace” and are ignored by the browser. The browser takes into account the width and height of its window. When you resize the browser window, the contents of the Web page are reformatted to fit the new size.
28
28 Basic Markup in XHTML The body element in the sample page contains 2 other elements: … is a heading element. … is a paragraph element. Welcome to the Website for CSE 1520 This is our first foray onto the World Wide Web. We are trying to learn how to create pages that can become part of the WWW. We hope to learn about elements of Structure, including: - headings - paragraphs - tables
29
29 Basic Markup in XHTML Headings in a document. There are six predefined heading levels in XHTML: h1, h2, h3, h4, h5, and h6. The heading level determines the typeface and size of the text, and the vertical spacing below the text. Paragraphs (... ) specify text that should be treated as a single paragraph. A paragraph always starts on a new line. Paragraphs are followed by vertical spacing.
30
30 Basic Markup in XHTML To cause text to start on a new line without vertical spacing, use the line break element: This empty element uses a single tag instead of a pair. To conform to the rule that all tags must be closed, the “ /” (space slash) are added to empty tags.
31
31 Lists in XHTML We often want to display a list of items. The … pair creates an unordered list, the … pair creates an ordered list, and the … pair distinguishes each list item.
32
32 A sample list a list item another list item and another list item This XHTML code will produce…
33
33 A sample list …this list in the browser.
34
34 Tables In XHTML, tabular data can be displayed by using a table comprised of rows of details. … tags surround the table … tags surround a row … tags define each detail (data)
35
35 Tables col1 row1 col2 row1 col1 row2 col2 row2
36
36 Tables XHTML requires that web pages be compatible with non-visual browsers. In the case of tables this means that a tag must include a summary attribute. The text in the summary provides a description of the table to users of non-visual browsers.
37
37 Tables The sample table as displayed in a browser.
38
38 Images An image can be incorporated into a Web page using the tag. This is another example of an empty element since it does not surround text, but instead indicates a point at which to insert the picture.
39
39 Images To specify where to find the picture to be inserted, the tag uses the mandatory src attribute. Note the other mandatory attribute - alt, which provides text to be displayed whenever the image cannot be.
40
40 Tag Attributes Note the syntax of tag attributes. The attribute name is followed by the equals sign (=), and then the attribute value, which is enclosed in quotes. – Either double or single quotes may be used.
41
41 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.
42
42 Links For example: CSE1520 Alternate Web Site Notes: The URL is enclosed in quotes. The link text between the tags is displayed in the browser, usually in underlined blue. However, this can be changed.
43
Cascading Style Sheets CSS
44
CSS Style Rules Style Rules tell the browser how a particular part of a web page is to be presented. Presentation refers to aspects of the display related to the text, like font, colour, size, etc. For example: body {background-color: yellow;} h1 {color: blue;} p {font-family: verdana; font-size: smaller;}
45
Applying Styles There are 3 levels at which style rules can be set : External level Styles are saved in a separate file (.css) The XHTML document links to the style sheet. Document level Styles are grouped within a … element, which is placed in the element. Inline level Style rules are set as the value of the style attribute of a specific element.
46
External level If our example styles are saved in YandB.css, then we can link it to an XHTML document this way: The document will now have a yellow background, level 1 headings will have blue text, and paragraphs will use a Verdana font, one decrement smaller than normal.
47
Document level Another way to apply styles to a document is to include them in the head. CSE 1520 body {background-color: yellow;} h1 {color: blue;} p {font-family: verdana; font-size: smaller;}
48
Inline level Welcome to the Website for CSE 1520 This is our first foray onto the World Wide Web. We are trying to learn how to create pages that can become part of the WWW. We hope to learn about elements of Structure, including: headings paragraphs tables
49
Cascading Styles The more local a style is defined, the higher is its priority. An External style applies to any document that links to the.css file. However, a style defined at the Document level will be replace an External style. Moreover, an Inline style will take precedence over either of the other two. This is why they’re called “cascading style sheets”.
50
Applying Style Sheets The advantages of applying style sheets at the External level, make it the current favourite. – Styles can be applied to the whole, or part(s) of a website without having to copy/paste them to multiple documents. – Modifying the presentation of the whole site, or any part of it, requires changes to only 1 file.
51
Interactive Web Pages
52
52 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 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.
53
Web page Behaviour This introduces a third aspect of web page design. In addition to Structure and Presentation, we now have – Behaviour. There are 2 levels at which web pages can interact, where we can program behaviour: Client-side Server-side
54
CLIENT-SIDE BEHAVIOUR Programs that run “in the browser”
55
55 Java Applets A Java applet is a program that is designed to be embedded in an HTML document using the applet tag. The file containing the program code is transferred over the Web, along with the text and graphics, then executed after the browser loads and displays the rest of the page.
56
56 Java Applets The browser has a built-in interpreter that executes the applet, which can collect input from the user and alter the page content. Consider the difficulties inherent in this situation. How can we expect a program that was written on one type of computer to run on possibly many other types of computers?
57
57 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.
58
58 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.
59
Scripts An alternative to applets is the use of scripts - programs written for a special run-time interpreter. These can be “embedded” or “external”. JavaScript and VB are examples of scripting languages.
60
SERVER-SIDE BEHAVIOUR Programs that run on the server.
61
61 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. Imagine JSP scriptlets as having the expressive power of a full programming language.
62
62 Java Server Pages JSPs are executed on the server - where the Web pages are stored. This execution creates (X)HTML code that is sent to the browser. 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.
63
Server-side Languages There are several popular alternatives to JSP. ASP CGI Perl PHP Python Ruby Tcl WebDNA
64
XML Structuring content
65
65 XML HTML is fixed. It has a predefined set of tags and each tag has its meaning. The tags specify how the content is organised, but there is nothing about HTML tags that indicates what the content represents. The eXtensible Markup Language, or XML, allows the creator of a document to describe its contents by defining their own set of tags.
66
66 XML XML is a metalanguage - a language for talking about, or defining, other languages. The Standard Generalized Markup Language (SGML) was used to define HTML. XML is a simplified version SGML used to enhance HTML.
67
67 XML Like HTML, an XML document is made up of tagged data.
68
68 XML Note line 2 of the example: This indicates the file that contains the definition (organisation) for documents of that type.
69
69 XML Document Type Definition (DTD) is a specification of the organization of the document. The structure of a particular XML document is described by its corresponding DTD document.
70
XML XML represents a standard format for organizing data without tying it to any particular type of output. Extensible Stylesheet Language (or XSL) is a language for defining transformations from XML documents to other output formats.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.