Table of Content


JAVA SCRIPT CLOCK

This will have to be placed inside your HEAD tag, in your document!
Here we go, it ain't pretty:
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDE FROM THAT BROWSER
var timerID = null
var timerRunning = false

function stopclock(){
     // cannot directly test timerID on DEC OSF/1 in beta 4.
     if(timerRunning)
      clearTimeout(timerID)
     timerRunning = false
}

function startclock(){
     // Make sure the clock is stopped
     stopclock()
     showtime()
}

function showtime(){
     var now = new Date()
     var hours = now.getHours()
     var minutes = now.getMinutes()
     var seconds = now.getSeconds()
     var timeValue = "" + ((hours 12) ? hours - 12 : hours)
     timeValue += ((minutes < 10) ? ":0" : ":") + minutes
     timeValue += ((seconds < 10) ? ":0" : ":") + seconds
     timeValue += (hours = 12) ? " P.M." : " A.M."
     document.clock.face.value = timeValue
     timerID = setTimeout("showtime()",1000)
     timerRunning = true
}
//-->
>/SCRIPT>
</HEAD>

&LT:BODY BGCOLOR=#****** TEXT=#****** LINK=#****** onLoad="startclock()">

<CENTER>
<FORM NAME="clock" onSubmit="0">
<INPUT TYPE="text" NAME="face" SIZE=14 VALUE ="">
</FORM>


MOUSE OVER WITH JAVA SCRIPT

Lets say you want to link to a Sample Page, and you want a little note on the bottom of the window. Here's what you would write: <A HREF="sample.htm" onMouseOver="window.status='Sample Page';return true">Samples</A>
Here's how it will show up, notice the text "Sample Page" being displayed , once you point your mouse over the link, on the bottom of your window:
Samples

Another examples which will show up messages by dragging your mouse over an object or a text:

Come to our Sample Page

This is how its done:(You can insert links in the A HREF="" section)

<CENTER><TABLE WIDTH="40%"><TR><TD><A HREF=""
ONMOUSEOVER = "alert('So you had to point your mouse here?')")>
<IMG SRC="dot.gif" BORDER="0" WIDTH="14" HEIGHT="14"></A></TD>
<TD ALIGN=RIGHT><A HREF=""
ONMOUSEOVER = "alert('So you had to point your mouse here again!')")>
Come to our Sample Page</A></TD></TR></TABLE></CENTER>

Again, you can change the message and insert real links into the link command. Don't forget to add your own image!


POP UP WINDOWS WITH JAVA SCRIPT

So you want to learn some java script?

That was done like this:

<INPUT TYPE="button" NAME="message" VALUE=" No " onClick="alert('Why not, just try!')">

Alert:

And this is how its done:
<CENTER><FORM>
<TEXTAREA NAME="text" ROWS="3" COLS="30"></TEXTAREA><p>
<INPUT TYPE="button" VALUE="Display it!"
onClick="alert(this.form.text.value)"> <INPUT TYPE="reset" NAME="cancel" VALUE="Reset">
&/FORM></CENTER><P>

This script does not have to be placed insight the head tag either, just paste it right in your own page, as you can see it is just for fun... so do just that, have fun with it!


THE JAVA SCRIPT GREETING

This greeting asks you for your name, then places the name on top of the page.

Here is how you have to put it in the HEAD tag of your document:

<SCRIPT LANGUAGE="JavaScript">

<!-- HIDE FROM OTHER BROWSERS
document.write("<B>Hello, ");
document.write(prompt("What is your name please?",""));
document.write(", and welcome to</B>

</P>");
//STOP HIDING FROM OTHER BROWSERS -->

</SCRIPT>

As always, you may change the Input of your message and also the greeting of your script!


LINK IN A DROP DOWN WINDOW

This is what it does:

This script has to be placed in the HEAD tag , and is of course changeable.
<HTML>
<HEAD>
<TITLE>Jump Box</TITLE>

<SCRIPT LANGUAGE="JavaScript">
<!--- Hide from tired old browsers
function jumpBox(list) {location.href =
list.options[list.selectedIndex].value}
// end hiding --->
</SCRIPT>

</HEAD>
<BODY BGCOLOR="#FFFFFF">

<FORM>
<SELECT>
<OPTION VALUE="here.html">Here
<OPTION VALUE="there.html">There
<OPTION VALUE="anywhere.html">Anywhere
</SELECT>
<INPUT TYPE="button" VALUE="Go"
onClick="jumpBox(this.form.elements[0])">

</FORM>

</BODY>
</HTML>

You may change the Value "Go there" to whatever you like, don't change anything in the Java script itself, just insert your links and the addresses.


E-MAIL WITH SUBJECT AND CC

This is very useful, you can have email send to you with a subject and CC.

Lets see how it looks:

As always its just an example, so don't bother actually sending it!

Here's how you do it:

<FORM>

<INPUT TYPE="button" VALUE="Click Here to Write to Me"

onClick="parent.location='mailto:someone@somewhere.com?subject=This goes to the subject box'">

</FORM>

Its as you can see a small script and comes without any header information or even a script beginning!

You can change all of these messages to your needs and also create variables from the examples provided.