PDA

View Full Version : Commemorative date display


dd_vuong
03-17-2003, 09:33 PM
Preview (http://dd_vuong.tripod.com/online/MYPAGE.HTM)

I have a device that displays the date and a description of the day's
observance (USA). For a preview click on the attached link.

Description of the database.
To use first link to the database with this code
<SCRIPT SRC="http://dd_vuong.tripod.com/online/COMMEMDATE_JS.TXT" LANGUAGE="javascript">
</SCRIPT>
There is an object class named CalendarADT, so create an instance like this
var aDate = new CalendarADT();
The aDate object has 3 methods:
(a) aDate.Short(): returns a string like "Monday 3/17/2003"
(b) aDate.Long(): returns a string like "Monday March17, 2003"
(c) aDate.Observance(): returns "No Observance" or a string describing the
day's observance.

Installing the display.
Assuming that you do not want to mess with DOM programming, you can get
the same dynamic effect using inline frame. If you do not know IFRAME yet
you can pick it up in a couple of minutes. It's a much simpler variation of the
FRAME concept. The idea is to put an IFRAME on, say, your homepage for the
actual display. But you first create an HTML page to extract information from the
database and write it out. This page is loaded into the IFRAME. Simple.
Copy the next two HTML files and view them.
(1) the "writeout" file named "showdate.htm":

<HTML>
<HEAD>
<SCRIPT SRC="http://dd_vuong.tripod.com/online/COMMEMDATE_JS.TXT" LANGUAGE="javascript">
</SCRIPT>
<SCRIPT LANGUAGE="javascript">
<!--
var aDate = new CalendarADT();

var strText = "<CENTER>" + aDate.Long();
strText += "<BR>" + aDate.Observance() + "</CENTER>";
document.open();
document.write(strText);
document.close();
// -->
</SCRIPT>
</HEAD>
<BODY STYLE="BACKGROUND:SILVER; COLOR:BLUE">
</BODY>
</HTML>

(2) your pretended homepage:

<HTML>
<HEAD>
</HEAD>
<BODY>
<CENTER><H2 STYLE="COLOR:RED">Welcome to my Page</H2></CENTER>
<IFRAME FRAMEBORDER=0 WIDTH=200 HEIGHT=50 SCROLLING=NO SRC="showdate.htm"
ALIGN =CENTER></IFRAME>
</BODY>
</HTML>

Try this out with some tweaking to get the variation that you like. Contact me if you decide you
want the complete database code.