The World Wide Web


The Web is what put the Internet on the map and made it a household word. Many people mistakenly think the Internet is the Web. The truth, however, is that the Web is merely an application that sits on top of the Internet.

The Web is built on the Hypertext Transfer Protocol (HTTP). HTTP is designed to be a small, fast protocol that is well suited for distributed multimedia information systems and hypertext jumps between sites.

Information on the Web is stored in pages. A page can contain any of the following:

  • Text

  • Lists

  • Tables

  • Graphics

  • Headers

  • Menus

  • Forms

  • Multimedia

  • Embedded objects and plug-ins (like Macromedia Flash)

Each Web page is an actual file saved on a host. When a Web page is requested, the file containing the Web page is read and its contents are sent to the host that asked for it.

A Web site is simply a collection of Web pages along with any supporting files (such as GIF or JPEG graphics). Creating a Web site thus involves creating one or more Web pages and linking them. The Web site is then saved on a Web server.

Web Servers

The Web consists of pages of information stored on hosts running Web server software. The host is often referred to as the Web server, which is technically inaccurate. The Web server is actually software, not the computer itself. Versions of Web server software can run on almost all computers, and although most Web server applications do have minimum hardware requirements, no special computer is needed to host a Web server.

Originally, all Web development was performed under different flavors of Unix. While most Web servers still run on Unix boxes, this is changing. There are now Web servers for most major operating systems. Web servers hosted on high-performance operating systems, such as Windows 2000 and Windows 2003, are becoming more and more popular because Unix can be more expensive to run than Windows, and is also more difficult to use for the average user. Windows 2000 and 2003 have proven themselves to be efficient, reliable, and cost-effective platforms for hosting Web servers. As a result, the Windows slice of the Web server operating system pie is growing dramatically.

So what exactly is a Web server? It's a program that serves up Web pages upon request. Web servers typically don't know or care what they're serving. When a user at a specific IP address requests a specific file (a Web page, or a part thereof), the Web server tries to retrieve that file and send it back to the user. The requested file might be the HTML source code for a Web page, a GIF image, a Flash movie, an AVI file, and so on. The Web browser, not the Web server, determines what should be requested. The Web server merely processes that request.

Pages are stored on the Web server beneath the Web roota directory or folder designated to contain all the files that make up the Web site. When a request is made for a specific page within a specific directory, that page is retrieved from the appropriate directory beneath the Web root.

Web servers enable administrators to specify a default Web page, a page that is sent back to the user when only a directory is specified. These default pages are often called index.html or default.htm. If no default Web page exists in a particular directory, the server returns either an error message or a list of all available files (depending on how the server is set up).

Web Browsers

A Web browser is the program used to view Web pages. The Web browser has the job of processing received Web pages, parsing the HTML code, and displaying the page to users. The browser attempts to display graphics, tables, forms, formatted text, and whatever else the page contains. The most popular Web browsers are Microsoft Internet Explorer and various Mozilla based browsers (like Firefox).

Web page designers must pay close attention to the distinctions between browsers because various Web browsers behave differently. Web pages are created using HTML (a language that we'll look at in a few moments). Unfortunately, not all browsers implement all of HTML consistently. Furthermore, the same Web page often looks different on two separate browsers because every browser renders and displays Web page objects in its own way.

For this reason, most Web page designers use multiple browsers and test their pages in every one to ensure that the final output appears as intended. Without this testing, some Web site visitors can't correctly see the pages you publish.

To request a Web page, the browser user must specify the page's address. The address is known as the URL.

NOTE

Web browsers communicate with Web servers and provide information about themselves to the servers. That information is then made available to application servers (such as ColdFusion). Within ColdFusion code, these variables are accessed using the CGI scope.


URLs

Every Web page (and indeed every object, even individual graphics) on the Web has an address. That is what you type into your browser to instruct it to load a particular Web page.

URLs are made up of as many as five parts:

  • The protocol to use to retrieve the object. This is always http for objects on the Web (or https for requests over secure connections).

  • The Web server from which to retrieve the object. This is specified as a DNS name or an IP address.

  • The host machine port on which the Web server is running. If omitted, the specified protocol's default port is used; for Web servers, this port is 80.

  • The file to retrieve or the script to execute. The filename often includes a complete file path.

  • Optional script parameters, also known as the query string.

There are generally two ways to go to a specific URL. The first is typing the URL in the Web browser's address field (or selecting it from a saved bookmark or favorite). The second is clicking a link within a Web pagea link is simply a reference to another URL. When a user clicks a link, the browser requests whatever URL it references.

HTML

Web pages are plain text files constructed with HTML. HTML is implemented as a series of easy-to-learn tags, or instructions. Web page authors use these tags to mark up a page of text. Browsers then use these tags to render and display the information for viewing.

HTML tags are always placed between < and >. For example, to force a paragraph break, you would specify <P>.

NOTE

Even though HTML is tag-based, it is not strictly typed as XML is. For example, HTML is case-insensitive, not all tags have matching end tags, and most browsers accommodate badly formed HTML rather well.


Some tags take one or more parameters in the form of attributes. Attributes are used to specify optional or additional information to a tag. Some tags have no attributes, while some have many. Attributes are almost always optional and can be specified in any order you want. Attributes must be separated from each other by a space, and attribute values should ideally be enclosed within double quotation marks.

HTML is constantly being enhanced with new features and added tags. To ensure backward compatibility, browsers must ignore tags they don't understand. For example, if you were to use the <marquee> tag to create a scrolling text marquee, browsers that don't support this tag will still display the marquee text, but it won't scroll. (And no, don't use the <marquee> tag, that was just an example).

Web browsers ignore white space, so the following two lines will be displayed identically:

 My name is Ben My     name     is     Ben 

Many characters have special significance to HTML. For example, the double quotation mark character is used to delimit fields and should therefore not be used in plain text. To display these characters, entity references are used; for example, &quot; for a double quotation mark character. Entity references always begin with an ampersand character (&), so to display an ampersand, the entity reference &amp; is used. Entity references are available for all special characters, including formatting and international characters.

JavaScript

Most current Web browsers allow the execution of JavaScript within Web pages. JavaScript is used to programmatically control the browser and the content it displays. JavaScript cannot be used to access the file system or to perform system-level operationsits scope is limited to the browser.

JavaScript plays an important part in usable and intuitive Web design in that it allows for more sophisticated and interactive user interface design, which in turn results in a richer and more rewarding user experience.

NOTE

JavaScript is not Java, and has nothing to do with Java. JavaScript is a scripting language, and Java is a true development language.


VBScript is another scripting language, but for the most part it is supported only by Microsoft Internet Explorer and is used far less than JavaScript.

Cascading Style Sheets

Cascading Style Sheets (often referred to as CSS) provide a mechanism by which to separate content from presentation. Instead of embedding HTML formatting in your text, you can create style definitions that the browser applies automatically when content is displayed.

Styles are associated with HTML types, so body text, links, headers, tables, and more can have associated attributes (everything from colors, fonts, and spacing to special effects that are not available using inline formatting). Additional styles can be created, too, so that developers can have maximum control over generated output.

All current browsers support CSS, although there are differences in the support. As such, any time CSS is used, thorough testing must be performed in as many browsers as possible.

Dynamic HTML

Dynamic HTML (or DHTML) is actually not a feature; it's a collection of features that when used together facilitates powerful browser UI control. DHTML combines HTML, scripting (usually JavaScript), CSS, and the DOM (document object modela convention that provides naming and programmatic access to every element of every page within a browser) to enable developers to write code that can be used to create very rich and sophisticated user interfaces.

The biggest problem with DHTML is that it is dependent on all of the aforementioned technologies, and their support differs dramatically from one browser to the next. As such, effective DHTML development often requires creating multiple versions of pages (or parts of pages) and intelligently including the appropriate ones as needed.



Macromedia ColdFusion MX 7 Certified Developer Study Guide
Macromedia ColdFusion MX 7 Certified Developer Study Guide
ISBN: 0321330110
EAN: 2147483647
Year: 2004
Pages: 389
Authors: Ben Forta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net