`
`.
`<html>
`Page Title
`{head}
`<title>l~low TEE'l'ntemet Horks<ft§ . >
`(meta http—equiv=“Content-Tgpe“ conten
`<Xheaa>
`
`Background Color
`<bodggeg'aat-qget4tFFFFFF“ l inkw‘aeaaam"
`(div id="uag§hl" stgle="position:abeoiu
`(div id="ta er " stgle=”position:absot
`(div id=" EiSF - stgle="position:abeoi‘
`(div id=“Lager4" stgle=”position:absol.
`(div id="Lager5" stgle="position:absolu
`(div id="Lagerfi" stgle="position:absott
`<p>(font size="3" face=”Vendana,
`flnia
`what’s happening behind the screens
`(p>(font size=“3“ faoe="¥endana,
`firi
`about creating your own Heb site, at
`(p}<font size="3" face="Vendana, flri
`all magic and madness to gou?<f
`finit
`(p><font size=”3“ face="Verdana,
`have come to the right place! Thie
`out of the Internet and explaining
`<p>anbsp; (/p>
`(p><font face=“Vendana, finial, Helve
`about:(.r’b}</font>(.r‘p>
`<p>(b}(font face="Vewduna, finiat, Mei
`Hnatomg of a Heb Site<fa§<£font§€
`<pb<b¥<font face-"Vendana, finial, Hal
`Hrchitecture of the Neb<,-"'t’ont}{.ft
`<p>(b>(font faoe="VePdana, finial, Hel
`Technologies on the Neb4ffomt}t
`(p> (fp}
`<p><font face="Verdana, Hhial, Hale
`<p><font faoe="Vendana, finial, Hela
`site uou will also find lots of k
`Hide Neb.(/font>(/Fv>
`dam
`(div id="Lager?" stgle="position:absol
`<p><font color="*999999"}<b><fon
`5i
`<p><font color="“9999CC"}<a href=“L.l
`<p><font color=““999999”>(b>{font 5i
`l<br>
`(a href="fiiflistawt.html">Hhat
`<p><font color=“*999999”}<b>{fen
`ll<br> Hyperlink
`(a href='part822tart.html“>The lr,a
`<p><font color="*999999">(b>{fon a.
`lll<br>
`(a href=”part835tart.html“>Connecti
`<p><font color=“*999999”><b>€fot
`a:
`lV<br>
`(a href=“part24start.html">Commani
`<p>(font color="“999999"><b>{fu
`at
`V(br>
`(font color="*5655CC">(a href=”pah
`<p><font oolor=”#999999"><b><fofi
`sf
`Vl<br>
`(font colon="#565600“>(a hraf=“Lr ts
`<p><font color="“999999"><b><€on
`5i
`Hll<br)
`(font color="“fififificc"><a href:”par
`Sp)(font color="*999999">(b>{fon sl
`Vlll<br5
`(font colori“*fififi5t0"><a hnaf=”pmh
`
`the internettfaxflant><,r'f.:m;v
`2: i
`
`<p>(font color=”*999999“><b}(fofi
`lX<bn>
`(font color="*fifififiCC"><a hnef‘"pn
`<p)€font
`color="*999999"><b>€frp
`_i
`to (hr)
`_
`Table of Pontents(flnut><fa>€
`<p>&nhsp;({p>
`<p> <£n>
`(fem
`(div id=”Lager8“ stgle=“po5ition:absoh
`(lmg arc="bfi!fifi$fi" width="151" height="7
`(div id="Lager9" stgle=”position:abso
`(div id="Lagerla" stgle="position:absa
`(div idr-"LageMl" stg1e="position:abso
`(food?
`<1html>
`
`e g
`
`fi
`:1L-
`
`is
`
`as
`
`a The coding in the HTML files tells your browser how to dis—
`play the text, graphics, links, and multimedia files on the
`home page. The HTML file your browser loads to display the
`home page doesn’t actually have the graphics, sound, multi-
`media files, and other resources on it. Instead, it contains
`HTML references to those graphics and files. Your browser
`uses those references to find the files on the server and then
`
`display them on the home page.
`
`[I The Web browser also interprets HTML tags as links to other
`Web sites, or lu ulher Web resources, such 05 graphics, mul-
`timedia files, newsgroups, or files to download. Depending
`on the link, it performs different actions. For example, if the
`HTML code specifies the link as another home page, the
`browser retrieves the URL specified in the HTML file when
`the user clicks the underlined link on the page. If the HTML
`code specifies a file to be downloaded, the browser down—
`loads the file to your computer.
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`Many types of files exist on the Internet that Web browsers can't display.
`In particular, this pertains to many kinds of multimedia files, such as
`sound, video, and animation files. Still, there are often references to
`these types of files on Web pages. To View or play these files, you need
`what are called helper applications and plug-ins. You must configure
`your Web browser or operating system to launch these helper applica-
`tions and plug-ins whenever you click an object that needs them in order
`
`
`
`
`to be viewed. Helper applications and plug-ins also can be used for dis-
`
`playing virtual reality pages, for-chatting on the lntemet, ahdeorReerIwu
`
`
` name... .. 4 .
`ling oth'erlnterrjet-tasks.
`‘
`—-I U 1
`.- ->-—r T 4-
`_..._
`'
`- _ —-—-—--I.-
`
`
`.
`
`
`
`The meanings of tags are easily decipherable. Every HTML tag, or
`
`instruction, is surrounded by a less-than and a greater-than sign—<P>.
`
`Often tags appear in pairs, the beginning tag and the ending tag. They
`
`
`are identical except for a simple slash in the end tag. So, a paragraph of
`
`
`text frequently is surrounded by tags such as this: <P> Paragraph of
`"“ —_J
`text.</P>. Also, tags artinpt case sensitive. s_P> equals <p>.
`
`
`
`151
`
`151
`
`
`
`
`
`
`
`What Common Browser
`
`Error Messages Mean
`
` DNS Server
`
`Server Does Not Have a DNS Entry When
`you type a URL in your browser to visit a
`site, your computer contacts a server called
`a Domain Name System (DNS) server. The
`DNS server translates the URL into the iP
`
`number that computers can understand-
`and after it does that, your browser can go
`to the site. (For more information about
`DNS servers, see Chapter 5, "How internet
`Addresses and Domains Work”) if you get
`an error message telling you the server
`doesn't have a DNS entry, it means that the
`server doesn't have a listing for the URL you
`typed. This usually means either you typed
`the URL incorrectly or something is wrong
`with the DNS server. Check the URL and
`retype it.
`
`503 Service Unavailable This is a catch-all error
`
`message for a variety of problems, but all of them
`mean that the Web site has been incapable of being
`contacted by your browser. The problem might be
`that the site’s server has crashed because of too
`
`much traffic or that there’s network congestion.
`
`‘1
`0'.
`
`Iit.“
`‘
`2 rr‘
` "»\do
`‘ SWEb Sé‘héeri
`
`I 403.9 Access Forbidden. Too Many Users Are
`Connected. Some Web sites recognize that if
`they get too much traffic al once, the entire site
`can be brought down and no one will be able to
`visit. Those sites put a limit on the number of
`people who can come to the site at once—that
`way, the site is always available, even if every-
`one who wants to visit can’t get in. If you get this
`”Too Many Users Are Connected” message, it
`usually means that the Web site is up and run-
`ning, but you can’t get in because the maximum
`number of people are already on the site. Keep
`trying—when one person leaves, another can
`come in, and it might be you.
`
`
`
`152
`
`152
`
`
`
`CHAPTER 22 HOW WEB BROWSERS WORK
`
`I39
`
`
`
`Web Server
`
`401 Unauthorized and 403 Forbidden
`
`If
`
`you get either of these error messages,
`you're trying to enter a Web site that
`allows only certain people in—and it’s not
`allowing you to enter. Typically, these
`types of Web sites are password pro-
`tected and also might allow only visitors
`who are from certain domains, such as
`zd.com. If you’ve entered a password,
`you might have entered it improperly, or
`you might not be in a domain that's
`allowed to enter the Web site.
`
`Spinning hourglass This isn’t an error
`message your browser displays—instead,
`your Windows cursor turns into a spinning
`hourglass. The spinning hourglass tells
`you that your browser is trying to make a
`connection to a Web site. if it keeps spin-
`ning and a connection is never made, it
`can mean that an Internet router some-
`
`place between where you are and where
`you're trying to visit has crashed and you
`can’t make the connection. lt can also
`
`mean that you’ve lost your local Internet
`connectioninrsnme reason.
`
`Web Server
`
`
`
` Firewall
`
`404 Not Found When you get this
`message, you’ve arrived at the correct
`Web site, but the specific page you’re
`looking for can’t be found. That spe—
`cific page might have been deleted
`from the site or moved—or you might
`have typed the location incorrectly.
`
`Router
`
`
`Web Server
`
`153
`
`153
`
`
`
`
`
`CHAPTER
`
`23
`
`How Markup
`Languages
`Work
`
`154
`
`154
`
`
`
`W-i'fi'
`
`
` WW5:
`(in: languages are the road signs of a Web page. They are sets of directions that tell the browser
`
`software how to display and manage a Web document, much like written music scores are instructions that
`
`tell a musician how to play a particular song. These instructions (called tags or markups) are embedded in
`
`the source document that creates the Web page.
`
`Tags reference graphic images located in separate files, and they instruct the browser to retrieve and
`
`display these images within the page. Tags can also tell a browser to connect a user to another file or URL
`
`when he clicks an active hyperlink. So each Web page has everything it needs to be displayed on any
`
`computer with a browser that can interpret the markup language.
`
`Your original text will probably have headings, multiple paragraphs, and some simple formatting. A
`
`Web browser will not understand all these layout instructions because the original text isn't formatted
`
`with HTML, the language of the Web (discussed later in this Chapter). Paragraphs, carriage returns,
`
`indents, and multiple spaces will be shown instead as a single space if no HTML markup is added.
`
`Markup languages should not be confused with programming languages, such as C+ or Pascal.
`
`Programming languages are used to write complex applications, such as word processors or spreadsheets.
`
`Markup languages, in contrast, are much simpler and describe the way information should be displayed~
`
`for example, by defining when text should be boldface. In markup languages, tags are embedded within
`
`dOCuments to describe how the documents should be formatted and displayed.
`
`Hypertext Markup Language (HTML) is the markup language of the Web. It defines the format of a
`
`Web document and enables hypertext links to be embedded in the document. You can use any text editor
`
`or word processor to add HTML tags to an ASCII text document, although a number of shareware and
`
`commercially available HTML editors can assist Web page authors as well.
`
`The Web evolves daily, and HTML also expands and changes along with it. The newest changes to
`
`HTML are a group of technologies that together are termed Dynamic HTML (DHTML). These technolo»
`
`gies allow HTML to be more than a static language, and they enable HTML to perform animations and
`become more interactive and flexible.
`
`The eXtended Markup Language (XML) promises to bring even more significant changes to the Web.
`
`It’s dramatically different from other markup languages because it separates the content of a page from its
`
`presentation. Rather than doing things such as giving instructions on text size, it tags different types of
`
`content and then has other technologies such as templates and style sheets determine how that content
`
`should look. For example, if a book were to be presented on the Web, it would tag chapter titles, chapter
`
`numbers, chapter text, and so on. It could then use style sheets to define how chapter titles, chapter numa
`
`bers, and chapter text should look. Doing this means you can build the content of a page once and present
`
`it to many different devices, and in many different ways, withOut doing much extra work.
`
`155
`
`155
`
`
`
`
`
`How HTML Works
`
`0 To display Web pages in any browser, you must add HTML
`lays in your original text. This process is called tagging.
`
`Page Title
`
`
`-
`.
`‘
`, a,
`
`
`dd! 9,- . r file.H‘a’itchnylwlwab_pagelhowitworks.html
`@ #13va Computer @ AppliSubporl ® Apple Store @ M3 MaoTopia ® HSN ©
`expludor @Googlu @cm @mgl @mg @mmml
`
`
`
`
`
`
`
`
`
`n
`der what's happening behind the
`Do you ever WU dive intfl the web?
`screen when YOU
`.ng vwr own Web EltB,
`bout creel:
`ou thought a
`rt?
`masteaiyen't sure where to sta
`
`
`
`but
`
`HTML Links
`
`
`
`
`
`
`
`
`
`Rpm“aimd
`
`
`
`.. zone
`
`156
`
`A
`
`
`
`«Illl
`
`
`
`
`
`156
`
`
`
`
`
`a Use HTML to give your text structure. All HTML
`files begin and end with the HTML tags. Headings
`are marked as such, as are paragraphs, line
`breaks, block quotes, and special character
`emphasis. Any carriage returns or indentations
`within the source text do not affect the browser’s
`display of the page. HTML tags need to be put in
`if they are to be displayed in a browser.
`
`B The finished HTML document will be the
`source page for any browser on any com—
`puter. This simplicity of HTML makes
`cross-platform compatibility easy and reli—
`able. The more complex and specialized
`the HTML tagging, the longer it will take
`to download and display the document.
`
`<html)
`(head)
`<title)l-low The Internet Horksdtitle)
`<
`ead)
`(pita http-equiv="Content-Tupe" contant="text/html; charset=iso-BB§Q-1")
`(body bgcolor="IFFFFFF" link="'665600" vlink=“"556l566">
`(div id="Layeri" stgle="pcsitionzabsolute;
`left:6alpx;
`tom-56px; midthHBBpx; heightl320px; z-index:1"><img src="rack.gif" width=”217" height="372“><fdiv)
`(div id="Lager2” stgle="positionzabsolute;
`leftw;
`topm; width:283px; height:352px; z—Index:2">(img src="rtslde.gif" width="125" height="456“xfdiv)
`(div idel’Lauera" stgle=“posltiontabsolute;
`leftzlafipx;
`topmpx; midtht494px; height:162px; z-index:3")<img src="title.gil" width="545" height="l73")<{oiv>
`ICCCCCC; border: 1px none '8
`(div id-"LageM" stgle="positlonzabsolute;
`left:91px;
`top:1aapx; midth:562px; height2875px; z-indexH; background-color: "000000;
`lager-background-eolor:
`(div id!"Lager5" stule="posltlomabsolute;
`left:5&bpx;
`tapasapx; widthHSb; helght:977px; z-index:5; background-color:
`.FFCCQQ;
`layer-background-color:
`'FFCCQQ; border: 1px none ‘68
`«um id-"Laylnfi" etuie="hnelrinnznhanlute:
`leftrllfipx:
`top:261p><' midthfibgpx; helghufimnx; z-index=5">
`<p><lont size="3” face="Verdana, Flrlal, Helvetlca, sans-serlf"£Do ou ever wonder
`what‘s happening behind the screen uphenlgwdditvei‘mto tthewfifi’l fénifidsfp)
`<p)<font size="3" lace="Verdana, Flrlal, Helvetica, sans-serlf">Have gou thoug‘it
`about creating Hour own Heb slte, but JusL ur'en'l. suie where to stun-tN/fonhfifp.‘
`<p><font size-"3" {ace="Verdana, Flrial, Helvetica, sans-serif">ls the internet
`all magic and madness to you?</font)</p>
`<p)<font slze="3" lace="Verdana, Flrial, Helvetica, sane-serlf”>uell
`than you
`have come to the right placel This Heb site is dedicated to taking the mgsteru
`out of the internet and explaining in clear terms How the Internet Horksldfontxfp)
`<p> < Hp)
`<p><font face-"Verdana, firial, Helvetlca, Ions-serif" slze-"3"><bWou will.
`learn
`about:<fb><.-’font><.u’p>
`(p><b)<font face="Verdana, firial, Helvetica, sans—serif" size="3”><a href=“ptB5_ch2102.html">The
`flnatomg o! a Heb Blte<fa><flont><lb><lp>
`<p><b><font {ace="Verdana, firial, Helvetica, sans-serif”><a hr‘elu“pt91_chalal.html")<font slze="3">The
`architecture of the uebdfontxjwdfentxfb><lp>
`<p><b><font
`lace="Verdana, Flrial, Helvetica, sans-serif"><a hrel="pta7_ch3285.html">(font slze=“3">Emerglng
`Technologies on the uehdrant><Ku><front><fb><fp>
`<p> Up)
`(pront face-"Verdana, Flo-lat, Helvetlca, sans-slrlf")Get ready to SURF!</font></p>
`<p><font faceu'Werdana, Flrlal, Helvetlca, :ans-nril“)fis gou cruise around thls
`site gou will also find lots of hyperlinks to other Bltex all across the Norld
`Hide Heh.</font></p)
`<fdiv>
`top:1QBpx; widthnagpx; heighufialpx; z-index:7">
`lelt:517px;
`(div id!”Lager?" stule="positlon:absolute;
`<p><reht coier=“-999999"><b><ront size="2" face="Verdana, firlal, Helvetlca, sans-lerll'"><a href-"lndex.html"><font column-gagged->Hone<flent><fa><frentx/bx/rentxfp)
`<p><ront color="|'OGQQCC"><a href="intro.html"><b)(font sizevz" face-"Verdana, Flrial, Helvetlca, sans-lerlI">lNTfiDDUCTl0N{/fontX/bxfaxlfontxfp)
`<p)<font color=""999999"><b><font size="2" face="Verdana, firial, Helvetlca, sans-nrll“>PFlHT
`l<br>
`<c: href="ptalstart.html">llhat Is the Internet?(.la)<ffontbeM/lontM/p)
`<p><lont color=“'99€999")<b><font
`size="2" (ace-"Verduna, firlal, Helvetlca, sans-seri{">PfiFlT
`l l<br>
`(a href=“partl25tart.html">The lnternet‘t Underlging Structure<fa><flont><fb><flont)(.r"p)
`<p)<font color=""999999")(b)<font size=”2" facee‘Werdana, firlal, Helvetlca, {ans-eeril">PHRT
`l
`l l<br>
`(a href="par~t935tart.html")Connecting to the Intemetdaxfront><lb></ront></p>
`<p><font color=""999999"><b>(font size="2" faceHWerdana, firlal, Helvetlca, sans-serlf">PfiHT
`IV<bP)
`(a href“‘partB4start.html“>Communicating on the internetda)</ront><fb></ront><fp>
`<p><font colore".999999”><b><font size=“2" {ace-“Verdana, Hrlal, Helvetlca, [ans-serlf">PfiFlT
`V(br>
`(font colorfl"'flfififlcc"><o hrel="partaflstart.html">How the Ndrld Hide Heb Horksdakflontxflontxbe/fontM/p)
`<p><font color="'999999"><b><font slze="2" facee'Werdana, Flrlal, Helvetlca.
`lans-sarlf">FFlFlT
`W (Dr)
`(font color="‘fififificc“)<a hre!="partafistart.html")Common Internet Toolz<fa><ffont><ffoht></b><ffontX/p)
`<p><font color-"‘QOOOQQ")<b)<font sizewl'2" face="Verdana, Flrlal, Helvetlca, sans-serll“)PRHT
`Vll<br>
`(font eoior="~flaoscc"><e href="parta7start.html")l‘lultlmedia on the lntemet<./a)</(ont>(/fant)</b>(r’iant>(.c’p)
`<p><font colore“‘999999"><b><font slze="2” (ac '"Verdanu, Hrlal, Helvetlm, sans-3erlf">FfifiT
`Vl l l<br>
`(font color="“5556CC"><a hre1=“partlastart.html")lntranets and Shopping on
`the Intametdax/ront></ront></b><frent><fp>
`<p><font color=""999999")<b><font size="2“ 1ace="Verdana, Flrial, Helvetica, sans-serif">PFIFlT
`|X<br>
`(font color="'66660l3"><a href="purl:ogstart.html">8afeguarding the lnternet</a)<!font}(/fant></b></font><i'p>
`<p><font color="‘999999“)<b><lont slzeu”2" Iace=“Verdana, Hrial, Helvetica. sans-serif"><a href=”Index.html"><font color="'BBBlB8">Fleturn
`to (hr)
`1mm of mnrnni-adfontx/aéqront,»<,/b><,rreht><.a‘p>
`<p)&hbsp;<f >
`<p> < p)
`<fdiv>
`(div id-“LagarB” stule="ppsl‘tion:absolute;
`(div id=“Lauer9" stgle="poxitlontabsolute;
`(div idI"Lager18" stgle="poeltio
`blolute;
`
`<
`only)
`<%v id-“Lauerll” 5tgle="pasltior .absalute;
`(fhtml)
`
`left:351px;
`left:12Bpx;
`left:2159x;
`left1512px;
`
`top:350px; midthlepr; heightil32px; z-index:9")<img src="bot.gi(" width="151" height="154"><fdiv)
`
`top:622px; uidtht77px; height:89px; z-index:9”><a href="map.html“)(img sr
`"map.gif" width="63" height="83" border="B"></a><fdi
`top:523px; widtthpx; height:76px; z-index:16“><a hre!="searchHIll.html")<img src="search.gll" width="83" height="93" border=‘
`top:522px1 width:6?px; heighttlelpx; z-index:11")<a href="helpme-html"><img src="help.gif" width=“83" height="83" border="6"»
`
`Title
`Ill-III-IIIIIIl-IIIIII-
`
`Graphic
`
`Graphic
`
`Text
`
`
`
`Hyperlinks
`
`w G
`
`raphic
`Hyperlink
`
`[I Most Web browsers enable your document to retain its structural integrity when you display, or parse,
`it. Headings will appear in a larger font size than text within paragraphs, for example, and block quotes
`will be uniformly indented. However, the look might vary from browser to browser. Note that browsers
`determine the exact font, size, and color. Also be aware that the relative importance of the elements is
`always kept intact.
`
`157
`
`157
`
`
`
`
`
`
`
`How Dynamic HTML Works
`
`Dynamic HTML (DHTML) differs from traditional HTML in that it enables Web pages to be
`changed on-the-fly, after they’ve been downloaded. In plain HTML, after a page is down-
`loaded, it is static and can be changed only when a user takes an action of some kind. But
`DHTML, for example, could cause an animation of a rocket to fly across your browser win-
`dow several seconds after the page has been downloaded—without your doing anything.
`
`.
`
`._
`
`-- —-
`
`_
`
`.
`
`_ Rflflgf€lt
`.5 6267166 /
`
`.
`
`'
`
`.
`
`.
`
`'
`
`_
`
`'
`
`_-
`
`" .,
`
`Welcome to «kn
`internation;
`home rocke
`club!
`
`p
`
`ROCKET SCIENCE
`
`Welcome to the international homc rocketry club!
`
`gum HERE TO LEARN Mom
`
`Q ‘6.
`
`'li
`
`
`page itself.
`
`a DHTML does its work without having
`to contact the server after the page
`downloads, so it can perform some
`interactive functions more quickly
`than other technologies that have to
`contact the server. The instructions
`
`for performing the commands are in
`the HTML commands that are in the
`
`158
`
`
`
`158
`
`
`
`CHAPTER 23 HOW 'MARKUP LANGUAGES WORK
`
`I45
`
`3 Although DHTML is often referred to as if it were a single technology, it is, in fact, a general term used
`for a group of technologies that can work together or by themselves to change a Web page after the
`page has been downloaded to your computer. These technologies are the Document Object Model
`(DOM), Cascading Style Sheets (CSS), and client-side scripting languages, such as JavaScript.
`
`Elements of DHTML
`
`Plain HTML
`
`Dynamic HTML
`
`Document Object Model (DOM)
`
`.
`
`#
`
`How
`
`lv)vHTll:IL
`
`or s
`
`HDngML
`
`-
`
`!.-»
`
`.
`
`n The DOM defines every object and element on a Web page and enables those objects to be manipulated
`or accessed. This includes fonts, graphics, tables, and visual elements, as well as elements you can‘t
`necessarily see, such as the browser's version number and the current date and time. Without DOM, all
`the elements on a page are static. So on the simplest level, DHTML could use the DOM to change the
`font of every letter, individually, on a Web page.
`
`Cascading Style Sheet
`
`3
`
`Plain HTML
`
`Dynamic HTML
`
`How
`DHTML
`
`Works
`
`E Cascading Style Sheets are, in essence, templates that apply formatting and style information to the
`elements of a Web page. They're called cascading because any single page can have more than one
`style sheet associated with it. Additionally, Cascading Style Sheets enable images to overlap one
`another. This enables animations to be created easily on a page.
`
`Plain HTML
`
`Dynamic HTML
`
`o
`o
`o
`0
`Cllent-Slde Scrlptmg
`
`" Haw
`’evlgmsl-
`
`:
`4
`
`.
`
`i
`How
`whilst.
`
`a Client-side scripting languages perform much of the work of DHTML. These languages access the DOM
`and manipulate its elements, and they do the same to Cascading Style Sheets. They perform the actions
`of DHTML. So a script, for example, could turn a word a different color when a mouse moves across it,
`or it could create easy—to-use collapsible navigation on every page on a Web site.
`
`159
`
`159
`
`
`
`
`
`How XML Works
`
`XML solves several a major
`problems for Web develnp-
`ers. Without it, to deliver
`Web pages to different
`devices such as computers,
`cell phones, and wireless
`Palm devices, a developer
`must create and maintain
`
`three separate Web sites,
`with special coding for each
`device—HTML for the com-
`
`_
`
`HTML
`
`Web Clipping
`
`n
`'
`
`,
`
`‘
`.
`
`l
`
`I
`
`I
`
`puter, WAP for the cell
`phone, and what's called
`Web clipping for the wireless
`
`Palm devices. It’s an expen-
`
`sive, difficult, and time-
`consuming proposition. And
`even if a developer is build—
`ing a site only for computers,
`every time the design
`changes, all the pages must
`be receded—again, an
`expensrve and Wm?
`consuming proposrtion.
`
`<Sale flyer>
`<0lfer>Get it While it's HoI!</0ller>
`<Promotional Copy>
`You can’t miss this one!
`One-time offer only —
`gaming synems at prices
`you wn’t believe! <IPmnwtional Copy>
`<Product>Sony PlayStations<lProduct>
`<Price> $l59.95<ll’rice>
`Sale ends <End Dale> l'lay l5
`
`
`
`
`
`Handheld
`
`’
`
`Cellular
`Telephone
`
`
`
`WAP
`
`E With XML, a developer can create the Web site just once.
`Then it can be automatically formatted to several types of
`devices, such as Internet—connected computers, wireless
`Palm devices, and cell phones using WAP. And even if
`the site is being built for only
`computers, when there is a
`redesign, with XML, all the
`pages need not be rebuilt.
`
`'
`
`:
`r
`
`-
`
`qm Datg>
`XML
`
`%
`"r-f/ ’SLT
`f
`B The most important concept to understand about XML is that the language is used only to convey informa-
`tion about content, not about the presentation of the content. So, for example, it doesn’t give instructions
`on what size text should be. But it uses tags to define the type of content on the page. Then it uses other
`techniques, as you'll see in the next steps, to display those pages. in that way, a single page can be dis—
`played many different ways, without having to go back and alter the original page—only the designs, which
`are separate from the content, need to be changed.
`
`160
`
`160
`
`
`
`a After the site knows what kind of device is visiting, it
`takes the XML, and using XSLT, changes it into the
`proper format—for example, a WAP document that
`the cell phone can view with its WAP microbrowser
`or an HTML document for a computer.
`
`
`
`‘Vfi-fflafldhad.
`
`Who- are viii?
`
`Here is your clipped Web parge.
`
`
`
`
`
`I’m a cellular phone.
`
`B When a device visits a site built with XML, there
`needs to be some way for site to know what type of
`device it is—— a computer, for example, or a cell
`phone. Common Gateway Interface (CGl) scripts can
`detect which device is contacting the site.
`
`Who are you.
`
`Here is your WAP.
`
` 1
`
`her it Winn; i'r'b law!
`
`You can't miss this one!
`One—time offer only ..
`gaming systems at
`prices you won’t believe!
`
`iI
`
`HTML
`
` Sale ends Ma! I5
`HTML document with a different design.
`
`When XML content is posted on a Web
`site, different designs need to be applied
`to that content so that it can be viewable
`
`by devices connecting to it—for example,
`cell phones. eXtensible Style Language
`Transformations (XSLT) can be applied to
`the XML. XSLI can take XML and apply
`different designs to it or change it to
`other forms of XML—for example, it can
`take the XML and turn it into a WAP page
`that can be viewed by a cell phone and
`take the same XML and turn it into a
`
`161
`
`161
`
`
`
`
`
`CHAPTER
`
`How Hypertext
`Works
`
`—.mun—n.
`...m....u—awu
`m
`J“.
`274“"«w... om ww“.m“""u
`mm...”-
`-wu‘u-..
`.. an»... u...»
`.15....mu m
`
`
`7—“
`~u. ... pm.“ mfilvlyluli
`mw—‘w a... Int—mug
`
`. 1w
`
` "am...“an...”
`
`it-u-vlw-‘nl-ImhhMM
`
`numb-um
`
`
`iti: 5
`
`nmnmmmmv.
`manna-mum
`nuwmmwnmqn
`.mY-I~D~U
`I‘D-“J‘Idnfl-Ipn
`nun-um mandamus-unwan-
`sun-ma mmmdhm-fl
`“autumn-hum
`
`162
`
`whoa—u”..-
`
`m- Inh-
`
`3??if
`
`162
`
`
`
`IN the late 19605, a computer scientist named Ted Nelson introduced hypertext, a concept that lays the
`
`foundation for the World Wide Web and its connections between documents, or pages.
`
`Nelson wanted to create a new way of exploring information. He wanted to provide the reader with a
`
`spontaneous means of accessing more and more in—depth information about something that sparked the
`
`reader’s interest when reading text on the page. Rather than reading a document from beginning to end,
`
`digesting the material in a sequential order, the reader could highlight a word and receive more information
`
`on the meaning of that word, for example.
`
`Nelson imagined that you could read the United States Constitution, come across the term “electoral
`
`college,” and then open another document that explains how the electoral college works. From that docu—
`
`ment, you might open another document that lists the votes of the electoral college from its founding to the
`
`present. From there, you might choosc to open a document about William Jefferson Clinton, then another
`
`about the First Cat, Socks, then another about the care and feeding of felines, and so forth. Ultimately, you
`
`could find a subject that wasn’t even remotely connected to the Constitution, but which you would find
`
`interesting or entertaining.
`
`This hypertext concept was obviously on Tim Berners—Lee’s mind when he began thinking about how
`
`researchers could share their work across the Internet. He envisioned a system in which a document could
`
`be linked to other documents, enabling researchers to easily find more and related information simply by
`
`following a link from one document on the network to another.
`
`Typically, hypertext consists of a hyperlink that appears onscreen as a highlighted word, icon, or graphic.
`
`By moving a mouse cursor over the item, or object, and clicking it, you easily navigate to additional infor»
`
`mation. On the Web, that information can be located at any other place on the Web, be it on the same host
`
`server or one across the globe. A linked object can be various media, such as text (linking from one charac—
`
`ter to a whole document, for example), a graphical button (such as direction arrows that move from page to
`
`page), or still images (photos, icons, or a comic strip), for example. The documents and objects that are
`
`being linked to can be on the same site as the original document or on an entirely different site.
`
`Hypertext links are embedded into a Web document using Hypertext Markup Language (HTML). A
`
`text link usually appears onscreen as an underlined word or phrase and is sometimes rendered in a different
`
`color from other text, depending on how your Web browser interprets the HTML codes. When you place
`the mouse cursor on this underlined text and click the mouse button, you initiate a request by the browser
`
`for a new Web page or—if the text references an internal link to information in the same document—direct
`
`your browser to scroll to another, specific point within the same document.
`
`Images or icons can also act as hyperlinks. When you move the mouse cursor over the icon or graphic
`
`and click the mouse button, you launch the request to retrieve the linked information.
`
`163
`
`163
`
`
`
`
`
`
`mummmm '
`hmmmmmmw‘nh‘
`gamut-unwind
`hmmJ-‘Mw—IEM’
`mmmmmhmmmlmw‘sm
`hmmmmmnmmmw
`
`”Mahayana-mm
`mnfibdlm
`
`
`
`
`umummmmmwh
`www.mmumhmnn
`mam
`
`
` Mama—nun.»
`m...
`'3” targéET’N’art 3
`
`The "hyperlinking" begins when you
`first retrieve a Web page from a remote
`Web server. Target links within the page
`move you quickly from one part of the
`page to the next.
`
`
`
`
`
`
`mmama». mam-MM»
`hMacnwwln—‘w
`
`
`
`
`
`
`
`
`164
`
`164
`
`
`
`a A relative link is used to initiate a request by your
`Web browser to retrieve a page located on the same
`Web server as the page from which you are linking. Web
`developers use relative links when they’re pointing to a page under
`their control because this enables the to more easily maintain their
`HTML coding if their server locations change.
`
`<a href="loursitelrelativelchapter_4.html">Chapter 4<Ia>
`‘7
`'
`
`mama-let
`Wlmlfilmmhlmm'v
`UmkdyiugAlrhila'lm
`
`
`
`
`
`
`"gnaw-muniti-
`
`‘*~.\..~u.a.~.
`
`“a....m
`
`4....—
`
`
`<a href="/oursite/relative/chapter_7.html">Chapter 7<la>
`
`flow lnlnnet l-‘du'l‘yw Wonk
`
`a A hyperlink that leads to a
`completely different Web
`server uses an absolute link.
`
`Because these links might not
`be under the control of the
`
`Web developer who created
`the page, there is a chance that
`this will be a ”dead link"—the
`
`page will have been moved
`without the Web developer
`knowing about it.
`
`
`
`
`
`
`
`
`
`lain—vi”rd-I! ‘ hid ml - Manna. AW Mimi!“ Brim 5pm!
`
`uwmmwnmmmnmmm.
`m a Humlnmgl
`Nm g MM;
`in m. Illn-
`gunlnm 5 gggngmy
`Run-flan a sauna
`-W
`mmmm.
`mm" Am. M... —|‘
`alumm
`com
`r- a. Imam mm
`mm
`E5
`.(mm- hm
`Inn-ulna
`"mm M
`_Ih‘h
`b".
`Wm. WWW"
`»Cun--M¢-¢vwamu
`.
`.
`.
`..
`.
`_ .
`
`<a href=www.yahoo.com><img src="searchyahoo.gif"><Ia>
`
`165
`
`165
`
`
`
`
`
`
`
`,n.
`m .
`nnnnnnnnn
`''''''
`
`166
`
`166
`
`
`
`TH E Web pages and the hosts that make up the World Wide Web must have unique locations so that your
`
`computer can locate and retrieve the pages. The unique identifier for a host is called the Internet Protocol
`
`(IP) address, and the unique identifier for a page is called the uniform resource Iocator (URL). A URL
`
`functions much like a postal or email address. Just as postal and email addresses list a name and specific
`
`location, a URL, or Web address, indicates where the host computer is located, the location of the Web site
`
`on the host, and the name of the Web page and the file type of each document, among other information.
`
`A typical URL looks like this:
`http : / /www. zdpress . com/internetwor‘ks/ index . html/
`
`If you were to interpret the instructions in this URL from left to right, it would translate to: “Go to the
`
`host computer called zdpr‘ess (a commercial business), in a directory called intor‘networ‘ks, and retrieve a
`
`hypertext document with the filename index. html.” The URL, or address, tells the browser which docu’
`
`ment to fetch and exactly where to find it on a specific remote host computer somewhere on the Internet.
`
`The first part of the URL indicates what type of transfer protocol will be used to retrieve the specified
`
`document. The most common request is for a hypertext document that uses Hypertext Transfer Protocol
`
`(HTTP).
`
`The second portion of the URL refers to the specific host computer on which the document resides,
`
`which is to be contacted by the browser software. This part of the address is also called the domain name.
`
`See Chapter 5, “How Internet Addresses and Domains Work,” for more information about domains.
`
`The third part of the URL is the directory on the host computer that contains a specific Web site or
`
`multiple Web sites. This is always located after the first single slash in the URL and is essentially the sub—
`
`directory on the hard disk that houses the Web site. Subdirectories might also be indicated in this part of
`
`the address. For example, if the previous URL were changed to http: //www. zdpress . com/
`
`internetworks/partone/chapters/chapte.html there would be two subdirectories—par‘t one and chapters.
`
`In the preceding example, the filename is chapte . html. This is always the last portion of the URL. If
`
`you see an address without a filename, it is assumed that the filename index . html contains the requested
`
`Web page. Therefore, the default document a Web server will deliver to the client when no o