![]() |
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?" (adapted from www.cybercheeze.com/humor/internet/) |
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.
After studying the lecture materials, and performing this experiment, students should be able to:
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.
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.
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.
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).
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.
![]() by Paul Joachim |
![]() |
|
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 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 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.
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 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 is a scripting language based on Visual Basic. Its capabilities are similar to JavaScript. Not all browsers support VBScriptlets.
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).
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.
Here is a list of steps from whatis.com in creating a web site.
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.
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.).
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).
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.
|
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. |
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.
The following is a mildly edited "Quick Reference Card" from
the webmonkey
/ reference site.
![]() |
|
| 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 |
| Send comments to pmateti@cs.wright.edu | 10/15/99 01:57:06 AM |