Parts Two and Three
Above I said that the Head commands break the page into
two distinct sections and also are loaded and run first. Where that comes into play is where you
have a script of some sort. Let's take JavaScript, for example.
If you place your JavaScripts in the HEAD commands then
they will be run first before the remainder of the page loads. Usually this is the case when the
JavaScript has two parts, a script, and then something that calls for that script to place an object
on the page. The Image Flip lesson is a good example of
this.
The purpose of separating the script from the element that
calls for it is to speed the use. The script is already running by the time the call is made for its
services.
As for separating the document into two parts, it is often
possible that two entities won't run together. Again, two JavaScripts, for example. Placing one
inside the HEAD commands and the other inside the BODY commands
tends to separate them enough to calm the fight. Often, though not always, they then both
run.
Adding a JavaScript to our Super Duper HEAD command
section, we get this:
<HEAD>
<TITLE>Big Fat Head Commands</TITLE>
<META NAME="keywords" CONTENT="key,word,key,word">
<META NAME="description" CONTENT="Great page! Come see!">
<META NAME="generator" CONTENT="Notepad">
<META NAME="author" CONTENT="Some Body">
<META NAME="copyright" CONTENT="Copyright © 2000 Me">
<META NAME="expires" CONTENT="15 September 2001">
<BASE HREF="HTTP://www.geocities.com/bisonhtml>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
</HEAD>
Ah, but it goes on. It is now possible to use these things
called Cascading Style Sheets to help pretty up your pages for
all. They go in the Head commands, too.
Add them in the recipe and you get the finished product:
<HEAD>
<TITLE>Big Fat Head Commands</TITLE>
<META NAME="keywords" CONTENT="key,word,key,word">
<META NAME="description" CONTENT="Great page! Come see!">
<META NAME="generator" CONTENT="Notepad">
<META NAME="author" CONTENT="Some Body">
<META NAME="copyright" CONTENT="Copyright © 2000 Me">
<META NAME="expires" CONTENT="15 September 2001">
<BASE HREF="HTTP://www.geocities.com/bisonhtml>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT>
<STYLE>
</STYLE>
</HEAD>
Well, there it is. The ultimate HEAD section of an HTML
document. Of course, all of that is not needed, but it can't hurt to add it. You'll be helping search
engines and some users of your site. I've altered the program I sometimes use to include the six
meta commands above already. I'm not so sure about the Base HREF command yet though....
Enjoy!
[Basic
HTML Format]
[What the HEAD Commands Actually Do]
[Information Regarding the Document]
[TITLE
Commands]
[META
Commands]
[Base
HREF Command]
[Parts 2 & 3]