Information Technology Reference
In-Depth Information
<ul>
<li><strong>Tommy</strong>: Take out the trash</li>
<li><strong>Beth</strong>: Clean out the fridge. </li>
<li><strong>Mittens</strong>: catch mice. </li>
</ul>
</body>
</html>
The code in Listing 1-7 will produce the exact same message as the code in Listing 1-6.
However, in Listing 1-7, I've passed the feline's name as a variable. The function
ShowWarning now expects that I'll pass a variable to be named “catname”, and it can use
that information in its code. When I call ShowWarning() in the body tag, I simply add the
cat's name to be passed to the function. I can pass more than one thing, if I want to. As
mentioned, this could get quite complex, depending on how much I want to chastise
poor Mittens.
As you can see, coupling JavaScript along with HTML and CSS can produce pages that
look good, are easy to update, and can interact with the user. But sometimes you might
need to produce a document that doesn't give style information-it just gives general
information. A prime example of this is given in the next section, as we start to get into
the wonderful world of XML!
Getting Informative: Extensible Markup Language (XML)
If you spend any time on the Web, you may have noticed an odd little icon on some
pages that looks something like this.
Figure 1-7. An RSS icon
This little orange icon tells the reader about an RSS feed that the current website has
available. RSS feeds look pretty uninteresting and unintelligible to a user (take a look at
Figure 1-8 for the start of an RSS feed). However, other web pages and scripts can use
them to grab a lot of information from one source and display it in different ways to the
user.
 
Search WWH ::




Custom Search