web
design
flower
radford university school of communication

Useful Code / Script

These are just some things we seem to be improvising all the time. Might as well put them in one place.


Meta tags:   

<head>

<title>This is important if you want search engines to find it </title>

<meta name="description" content="This describes your site">

<meta name="keywords" content="you, your friends, your resume, your pictures, your family, etc">

(Note: Other sytle and CSS information would also go here )

</head>

<body >


Refresh to another page or site:   

<html><head>

<meta http-equiv="Refresh" content="1; URL=http://www.anothersite.com">

</head></html>    


Include another web page in the current page  (alternative to frames)

<!-- #include virtual="filename.html" --> 


Attach CSS Style Sheet to current page 

<link rel="stylesheet" href="yourstyle.css" type="text/css">
<style type="text/css">

</head>


Warning before moving on to the next page

Use this script in the head:

<script type="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</script>

And this in the body

<a href="yourpage.htm" onClick="MM_popupMsg('Warning quote about
copyright.')">
Visible hyperlinked text
</a>

Obviously, yourpage.htm is the one that has the photos.
Also, "Warning quote about copyright" needs to be changed. And
Visible Hyperlinked Text would need to be changed, too.
Obviously, also, this is a MacroMedia Dreamweaver tag. I tested it
and it seems to work fine on FIrefox.


Floating note box

Use this script in the head

<SCRIPT>
<!--//
function openwin()
{
window.open("","x",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width=200,height=350,resizable=1');
}
//-->
</SCRIPT>

And this in the body:

<A HREF=notebox.html" TARGET="x" onClick="openwin()">Floating note
box </A>

 


Dont use frames. Seriously. This is an archaic technique. If you must use frames, put this in the body

<frameset cols="*,80">

<frame src="file1.html" name="file1">

<frame src="file2.html name="file2">

</frameset>

Comment: this sets up rows or cols (columns) or both. Here we have a full page with an 80 pixel column on the right side. So we could have had frameset rows="100" cols="80,*" and that would give us a top and left side frame. In the frameset tag you can also include variable attributes such as these:

frameborder="no" border="0" framespacing="0"

Note also that you have to have separate files for each of the holes created in the frame.


 

Server Side Includes (list from Carleton University)