wsu-logo EGR 199:
Fundamentals of Engineering

Creating Your Own Web Site

  10/15/99 Prabhaker Mateti
     

Top Ten Signs You're Not Spending Enough Time On The Internet

10. You've never used the pickup line, "What's your URL?"
9. You don't need carpal tunnel surgery yet.
8. Poor spelling annoys you.
7. You've seen the inside of a shower stall at least once in the past 48 hours.
6. You replaced your worn-out keyboard only once last month.
5. --open--
4. Your closest friends call you instead of e-chatting
3. --open--
2. You still have the capacity for speech.
1. Your repertoire of emoticons hasn't hit double figures.

(adapted from  www.cybercheeze.com/humor/internet/)


Table of Contents


Executive Summary

This document explains the internals of Web page creation and publication to a Web server. It presents examples of HTML, Java applets, and JavaScript methods.

The document serves as support material for a term project (Web Design Project), and also as a description of a 2-hour computer lab.


Educational Objectives

After studying the lecture materials, and performing this experiment, students should be able to:

  1. Develop simple web pages using WYSIWIG HTML editors.
  2. Publish their web pages using an FTP client.
  3. Understand the contribution that Java applets and JavaScriptlets make in making the web pages visually interesting and more functional.

Suggested Preparation

Prior to performing the experiments of this Lab, you must read this document in its entirety. If you have a home computer, please try at home the exercises of Procedures section.


Background Information

Strictly speaking, the Internet and the Web are not one and the same. The Web refers to a body of information - an abstract space of knowledge in the form of linked pages, while the Internet refers to the physical side of the global network, a giant mass of cables and millions of computers.

What is in a Web Page?

A web page is an ordinary text file containing an HTML header and body.  A web can be of just one page, or many pages linked in a complex way. A `` web page'' often prints as several printed pages. Its look and feel is governed by tags in HTML, and little programs written in the programming languages Java, and JavaScript, or in ActiveX, etc.  A web site is a collection of pages appropriately linked with one well-defined entrance to the collection.

HTML - The Hyper Text Markup Language

The Web uses HTML for creating and recognizing hypermedia documents. HTML documents are nothing more than standard 7-bit ASCII files with formatting codes that contain information about layout (text styles, document titles, paragraphs, lists, formatted tables, graphics, ...) and hyperlinks. HTML allows document writers to separate information from document presentation - that is, documents containing the same information can be presented in a number of different ways. Users have the option of controlling visual elements such as fonts, and paragraph spacing without changing the original information.

The current standard is HTML 4.0.   See Appendix C for a quick reference card. Appendix B has a link to an HTML 4.0 Reference Manual (as a zip file).

Animated GIFs

Here are three examples. An animated GIF file contains several picture frames compressed together into one file. These frames are displayed in rapid succession as in photographic film based movie theatres. Animated GIFs consume CPU cycles heavily. When they are together, as in the example below, and your CPU is slow (say below 300 MHz) you can see the animation as being jerky. So, use animated GIFs sparingly. Both Netscape and IE can disable (temporarily or permanently) animation of GIFs; press the ESC key.

humming bird
by  Paul Joachim

by Michael R.Wooster

by Fiely A.Matias

Interactive Pages

Dynamic HTML, Java, JavaScript and ActiveX are technologies that let programmers create animated and interactive Web pages--the kinds that move, flash, and play games. HTML , in contrast to Dynamic HTML, can't do much to make a page interactive; Java, JavaScript and ActiveX fill that void.  Java, JavaScript, VBScript and ActiveX are not mutually exclusive--they can work together.

Dynamic HTML

Dynamic HTML is an emerging technology that lets programmers create animated and interactive Web pages--the kinds that move, flash, and play games, just like Java, JavaScript and ActiveX do.

Java

Java is a programming language similar to the popular C++ language used to make applications like word processors or spreadsheets. Java programs -- known on the Web as applets -- have the unique ability to run on any operating system, from Windows to Mac to Unix. A Java applet is compiled into a byte-code file, which is downloaded into your machine as needed.

While lots of  ready-made applets are available and can be plugged into Web pages, programming in Java from scratch is not a Saturday afternoon activity.
 

This is a Java implementation of the classic Rubik's Cube by Karl Hörnell (1996). 

Twist or rotate the cube by clicking the mouse on the cube and dragging (click-and-hold and move up down right or left).  Click on the cube and then press s to scramble and r to restore.

The source code is undocumented.

  Below is a very simple Fireworks program by Prabhaker Mateti
  • Each mouse click will produce a new firing.
  • See also what
    • the refresh button does.
    • the back/forward buttons do.

Do take a look at the source code.

 

The above is the well-known 15 puzzle. Coded by Prabhaker Mateti

Do take a look at the source code. The HTML tag for the applet was: <applet code="Puzzle15" codebase="JavaClasses" align="baseline" width="200" height="200"> </applet>

JavaScript


Scroll the Marquee
Change Background Color
New Marquee
Old Marquee
  JavaScript is a scripting language, a special kind of programming language that makes it easy for the programmer to manipulate (e.g., pop up, close, flash colors) windows, fill in and submit forms, and compute strings. You can view the JavaScript source code of a Web page.  JavaScript can tie other components together or programmed to accept user input. While the names are confusingly similar and both Java and JavaScript are languages designed to make Web pages more interactive, Java and JavaScript are two different things. 

Here is an example of JavaScript in action. Move the mouse over the elements of the table at left and see what happens!

The JavaScript code that exchanged the two WSU logos was

<a href="javascript:return true"
onmouseover="var t = wsulogo0.src; wsulogo0.src = wsulogo1.src; wsulogo1.src = t">
<img src="../../images/wsu-logo-xsm.gif" border="0"  name="wsulogo0" ></a>
<a href="javascript:return true"
onmouseover="var t = wsulogo0.src; wsulogo0.src = wsulogo1.src; wsulogo1.src = t;">
<img src="../../images/wsu_seal_green_xsm.gif" border="0" name="wsulogo1"></a>

VBScript

VBScript is a scripting language based on Visual Basic. Its capabilities are similar to JavaScript. Not all browsers support VBScriptlets.

ActiveX

An ActiveX control is roughly equivalent in concept and implementation to the Java applet.  Whereas a Java applet can run on different systems, ActiveX runs only on MS Windows. An ActiveX control is typically written in C++ and compiled into a machine-code file for Intel x86 architecture, which is loaded into your machine as needed. Whereas Java and JavaScript are multi-platform programming languages, ActiveX controls are not cross-platform, work only with Internet Explorer, not Netscape's browsers (without a plug-in).


Creating your own Web Site

First, check out a few simple design examples by visiting http://www.cats.wright.edu/catsweb/images/default.html.  You can save these pages and start editing them as you like.  Make sure that all image files are also saved in IE4 and Netscape 4.5x or earlier.  You can save each image by right-clicking and choosing to save.

A Few Steps

Here is a list of steps from whatis.com in creating a web site.

Learn HTML -- Not?

It is possible to create a Web page without learning HTML using recent versions of word processing packages such as MS Word and Corel WordPerfect, or by using a Wysiwyg HTML page creator, such as Microsoft's FrontPage, or Netscape's Composer.  We recommend Netscape Composer (in the room 141 RC). Or, you may prefer to use MS Word. In MS Word, edit your files as usual, but at the moment of saving, choose to Save As "Web pages" or as type "HTML".   The full scale web creation tools like MS Front Page 2000, or Macromedia DreamWeaver have many more features and built-in tools tuned for the web.

For greater control over your web page, learn HTML, and use a good text editor such as Emacs that understands HTML tags.  However, learning HTML, even from a good tutorial, is an arduous task.  Appendix B has a link to an HTML 4.0 Reference Manual (as a zip file), another to a tutorial.

Occasionally, you should see the actual source code of an interesting page. Both Netscape and IE have a "View Source" item in their menus. Most commercial web sites make heavy use of tables, and this makes the source look very complex, and learning from such examples is difficult.


Publishing

After you've built and tested your Web site on your own computer, you put the files on a computer that has a Web server so that your site will be accessible to the world. This is known as publishing. And, once your site is part of the Web, you'll want to update files on some periodic basis. The final step is to send files. You'll need ftp or web-publishing software to do this. In 141 RC, use the tool called WS_FTP. Read the Appendix D for details on publishing at WSU.

One of your html files - the first page - has to be named either default.htm or index.htm for your site to work properly. Server software enforces a rule that once a connection is made to a directory it will automatically load and display one of these two pages. Your ISP can tell you which one works for his setup. (Some servers still enforce the use of a ".html" instead of ".htm" at the end of your files.) Organize your files into logical subdirectories. In a small site put all your gifs and jpegs in a folder/directory called something like "images". Make sure your html reference code then says "images/picture.jpg". Larger sites require additional category folders (sounds, archive, databases, etc.).


Procedures

Your goal is to develop and publish your own home page. To do a good job can easily take several days. For now, reduce your goal to compose a web page using as many of the elements listed below as possible, within the 110 minutes allotted to this lab.

The work you do today can be the starting point for the Project 2 of the term.  So, do your best!

Note also that this lab is scheduled as "Instrumentation Lab," but you will be doing the web work in the Computer Lab (141 RC).

  1. Create a new file called webDesign.txt to journal your composition of the home page, and to include your thoughts. Include at the top your full name and SSN.
  2. Check out a few simple design examples by visiting http://www.cats.wright.edu/catsweb/images/default.html. You can save these pages and start editing them as you like.
  3. You may use any HTML editor that you are comfortable with. (See the section on Learning HTML.)  Your page should, minimally, have the following web page elements:
  4. Let your home page contain whatever you wish but it must be "professional.". Some suggestions are: your resume, your interests, etc.
  5. Publish the home page you developed in two places: our WSU's recommended site (~/www/) for student homepages, and also at the free site you discovered in a previous lab. To publish your pages on the WSU web site, use the WS_FTP tool.
  6. Include your contribution to fill in items 5 and 3 of the Top Ten Signs You're Not Spending Enough Time On The Internet in the file webDesign.txt.
  7. Include the URLs for your homepages, and any feedback you wish to give us in the file webDesign.txt.

Concluding Activities

See below.

Achievement Test

Send the file webDesign.txt to your lab TA via email, with EGR199-webDesign as the subject.  Your TA will verify that the web pages whose URLs are included in the file sent are looking fine.


Appendix A: Acronyms

   
FTP File Transfer Protocol
GIF Graphics Interchange Format
HTML Hyper Text Markup Language
HTTP Hypertext Transfer Protocol
JPG (JPEG) Joint Photographic Experts Group
URL Uniform Resource Locator
WWW World Wide Web
Wysiwyg What You See Is What You Get
A few acronyms and their expansions are collected in the table here. If you are curious about an acronym or term not listed, type it in the input box below, and then press the button to look it up in the TechEncyclopedia.



Appendix B: Further Reading Links

For the 2-hour lab, there is no need to visit any of the following. But for the Web Design Project, visit the following sites at least once to familiarize yourself with what is available.


Appendix C: HTML Syntax Quick Reference

The following is a mildly edited "Quick Reference Card" from the webmonkey / reference site.
 

for HTML tags, etc.

    Basic Tags
<html></html>   Creates an HTML document
<head></head>   Sets off the title and other information that isn't displayed on the Web page itself
<body></body>   Sets off the visible portion of the document
     
    Header Tags
<title></title>   Puts the name of the document in the title bar
     
    Body Attributes
<body bgcolor=?>   Sets the background color, using name or hex value
<body text=?>   Sets the text color, using name or hex value
<body link=?>   Sets the color of links, using name or hex value
<body vlink=?>   Sets the color of followed links, using name or hex value
<body alink=?>   Sets the color of links on click
     
    Text tags
<pre></pre>   Creates preformatted text
<h1></h1>   Creates the largest headline
<h6></h6>   Creates the smallest headline
<b></b>   Creates bold text
<i></i>   Creates italic text
<tt></tt>   Creates teletype, or typewriter-style text
<cite></cite>   Creates a citation, usually italic
<em></em>   Emphasizes a word (with italic or bold)
<strong></strong>   Emphasizes a word (with italic or bold)
<font size=?></font>   Sets size of font, from 1 to 7
<font color=?></font>   Sets font color, using name or hex value
     
    Links
<a href="URL"></a>   Creates a hyperlink
<a href="mailto:EMAIL"></a>   Creates a mailto link
<a name="NAME"></a>   Creates a target location within a document
<a href="#NAME"></a>   Links to that target location from elsewhere in the document
     
    Formatting
<p>   Creates a new paragraph
<p align=?>   Aligns a paragraph to the left, right, or center
<br>   Inserts a line break
<blockquote></blockquote>   Indents text from both sides
<dl></dl>   Creates a definition list
<dt>   Precedes each definition term
<dd>   Precedes each definition
<ol></ol>   Creates a numbered list
<li>   Precedes each list item, and adds a number
<ul></ul>   Creates a bulleted list
<li>   Precedes each list item, and adds the bullet
<div align=?>   A generic tag used to format large blocks of HTML, also used for style sheets
     
    Graphical Elements
<img src="name">   Adds an image
<img src="name" align=?>   Aligns an image: left, right, center; bottom, top, middle
<img src="name" border=?>   Sets size of border around an image
<hr>   Inserts a horizontal rule
<hr size=?>   Sets size (height) of rule
<hr width=?>   Sets width of rule, in percentage or absolute value
<hr noshade>   Creates a rule without a shadow
     
    Tables
<table></table>   Creates a table
<tr></tr>   Sets off each row in a table
<td></td>   Sets off each cell in a row
<th></th>   Sets off the table header (a normal cell with bold, centered text)
    Table Attributes
<table border=#>   Sets width of border around table cells
<table cellspacing=#>   Sets amount of space between table cells
<table cellpadding=#>   Sets amount of space between a cell's border and its contents
<table width=# or %>   Sets width of table - in pixels or as a percentage of document width
<tr align=?> or <td align=?>   Sets alignment for cell(s) (left, center, or right)
<tr valign=?> or <td valign=?>   Sets vertical alignment for cell(s) (top, middle, or bottom)
<td colspan=#>   Sets number of columns a cell should span (default=1)
<td rowspan=#>   Sets number of rows a cell should span (default=1)
<td nowrap>   Prevents the lines within a cell from being broken to fit
     
    Frames
<frameset></frameset>   Precedes the <body> tag in a frames document; can also be nested in other framesets
<frameset rows="value,value">   Defines the rows within a frameset, using number in pixels, or percentage of width
<frameset cols="value,value">   Defines the columns within a frameset, using number in pixels, or percentage of width
<frame>   Defines a single frame - or region - within a frameset
<noframes></noframes>   Defines what will appear on browsers that don't support frames
     
    Frames Attributes
<frame src="URL">   Specifies which HTML document should be displayed
<frame name="name">   Names the frame, or region, so it may be targeted by other frames
<frame marginwidth=#>   Defines the left and right margins for the frame; must be equal to or greater than 1
<frame marginheight=#>   Defines the top and bottom margins for the frame; must be equal to or greater than 1
<frame scrolling=VALUE>   Sets whether the frame has a scrollbar; value may equal "yes," "no," or "auto." The default, as in ordinary documents, is auto.
<frame noresize>   Prevents the user from resizing a frame
     
    Forms
    For functional forms, you'll have to run a CGI script. The HTML just creates the appearance of a form.
<form></form>   Creates all forms
<select multiple name="NAME" size=?></select>   Creates a scrolling menu. Size sets the number of menu items visible before you need to scroll.
<option>   Sets off each menu item
<select name="NAME"></select>   Creates a pull-down menu
<option>   Sets off each menu item
<textarea name="NAME"
cols=40 rows=8></textarea>
  Creates a text box area. Columns set the width; rows set the height.
<input type="checkbox"
name="NAME">
  Creates a checkbox. Text follows tag.
<input type="radio"
name="NAME" value="x">
  Creates a radio button. Text follows tag
<input type=text
name="foo" size=20>
  Creates a one-line text area. Size sets length, in characters.
<input type="submit"
value="NAME">
  Creates a Submit button
<input type="image" border=0
name="NAME" src="name.gif">
  Creates a Submit button using an image
<input type="reset">   Creates a Reset button

Appendix D: Publishing Your Web Site at WSU

  1. Every WSU student has an e-mail address and a URL.   For example, if your e-mail address is  smith.199@wright.edu, then your URL is  http://www.wright.edu/~smith.199     Note that the address is case sensitive, so ~Smith.199 will not work.  Remember that all persons using WSU resources to store or serve web files must adhere to the WSU Web Policy.
  2. Your web pages can be created using any one of HTML editors on any computer system (Unix, Windows 9x/NT, or Mac).  The procedures of this section assume that you have placed all your web files in a directory called www
  3. To set up your web site on WSU, ftp the web file(s) to your UNIX www directory as follows.
    1. Invoke our FTP client WS_FTP.
    2. Click Connect/New and fill in the HostName as either paladin.wright.edu or discover.wright.edu
    3. WS_FTP will ask for your Unix user name and password. (Caution: Do not let WS_FTP save your password.)
    4. Change directory (button labeled ChgDir) to the parent of the local folder www  containing your web files. Make sure that you named the main page within www as index.htm.
    5. Upload the entire www directory (put) of your web files  (HTML, GIF, ...) from your PC to the remote directory by selecting  www in the left pane of the WS_FTP window, and  then clicking on the button labeled with a right arrow (-->). If the directory www was not already there on the remote Unix system, WS_FTP will request Unix on your behalf to create it first before uploading the files in it.  Once you have placed the main page file in your Unix www directory, your web site will be accessible to anyone using the WWW, and a hyperlink will appear in the University's online directory.
  4. To update your web site on WSU, revise the files, and ftp the web file(s), as above, to your UNIX www directory.
  5. Occasionally, you will find that a browser continues display an old version of a web page even after you had uploaded a new page to the web server.  This is due to disk cache.  Both Netscape and IE can clear the disk cache.  In IE, go to Tools/Internet Options/Temporary Internet Files/Delete Files.  In Netscape, go to Edit/Preferences/Advanced/Cache/Clear Disk Cache.

Send comments to pmateti@cs.wright.edu
10/15/99 01:57:06 AM