September 24th, 2009
1: <!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
2:
3: <HEAD>
4: <SCRIPT LANGUAGE="JavaScript">
5: <!-- Original: Massimo Giari (motore@iol.it) -->
6: <! >
7: <! >
8: <!-- Begin
9: var clocktext, timeday;
10: var pagetitle = document.title;
11: function scroll() {
12: today = new Date();
13: sec = today.getSeconds();
14: hr = today.getHours();
15: min = today.getMinutes();
16: // 12 Hour clock fix by Michael Mann (pres@manninc.com)
17: if (hr < 12) { timeday = " AM"; }
18: else { timeday = " PM"; }
19: if (hr > 12) hr = hr - 12;
20: if (hr <= 9) hr = "0" + hr;
21: if (min <= 9) min = "0" + min;
22: if (sec <= 9) sec = "0" + sec;
23: var clocktext = " - " + hr + ":" + min + ":" + sec + timeday;
24: clocktimer = setTimeout("scroll()", 1000);
25: document.title = pagetitle + clocktext;
26: }
27: if (document.all) scroll();
28: // End -->
29: </script>
Tags: clock, title bar
Posted in Date/time | No Comments »
September 24th, 2009
1: <!-- STEP ONE: Put this code into the HEAD of your HTML document -->
2:
3: <HEAD>
4: <SCRIPT LANGUAGE="JavaScript">
5: <!-- Original: Francis Woodhouse (francis@contessa.u-net.com) -->
6: <! >
7: <! >
8: <!-- Begin
9: function runClock() {
10: theTime = window.setTimeout("runClock()", 1000);
11: var today = new Date();
12: var display= today.toLocaleString();
13: status=display;
14: }
15: // End -->
16: </SCRIPT>
17:
18: <!-- STEP TWO: Put this code onLoad event handler in the BODY tag -->
19:
20: <body onLoad="runClock()">
Tags: clock, status bar
Posted in Date/time | No Comments »
March 4th, 2009
2 examples handy for when a user enters data on a form
<div align=”center”>
<form name=lowerexample”>
<input type=”text” name=”caps” size=”40″
value=”" onChange=”javascript:this.value=this.value.toLowerCase();”>
<br>
<input type=”button” value=”convert”>
</form>
</div>
<div align=”center”>
<form name=”upperexample”>
<input type=”text” name=”caps” size=”40″
value=”" onChange=”javascript:this.value=this.value.toUpperCase();”>
<br>
<input type=”button” value=”convert”>
</form>
</div>
Tags: toLowerCase, toUpperCase
Posted in text | No Comments »
February 23rd, 2009
This simply pops up an alert box when you push a button
Tags: alert
Posted in Alerts | No Comments »
February 23rd, 2009
<form>
<input TYPE=”button” VALUE=” BACK ” onClick=”history.go(-1)”>
<input TYPE=”button” VALUE=”FORWARD” onCLick=”history.go(1)”>
</form>
Tags: history.go
Posted in Buttons | No Comments »