Display a changing text

  • Thread starter Thread starter standup
  • Start date Start date
S

standup

I do stand up comedy and want my website to display my next jobs. Can I use
a database or spreadsheet to control this and have the displayed text change
based on the date and time set out in a database or spreadsheet? I have FP
20902.
 
standup said:
I do stand up comedy and want my website to display my next jobs. Can I
use
a database or spreadsheet to control this and have the displayed text
change
based on the date and time set out in a database or spreadsheet? I have
FP
20902.

You could even do this with JavaScript. Write a page for each new day and
when that day comes, as determined by the JS, load that page, perhaps into a
inline frame.

I have done this with a calendar, so that when it is 1 November (say) the
November calendar is loaded rather than the current one (October) .
 
I have done this with a calendar, so that when it is 1 November (say) the
November calendar is loaded rather than the current one (October) .

And it works really really well, too! 8)
 
An example of opening a calendar is on this site
http://tandcl.homemail.com.au/ . If you click on the button or on the
calendar image, it opens this month. The script is quite complex, but to
just open a file say "jobs20081029.html" in an iframe, try this (not tested
but based on similar code that works)

HTML
<input type="button"
value="Open/Close
Today's News"
title="Open/Close
Today's News"
onclick="loadIframe('News')" >
<iframe id="News" src=""></iframe>

JS
function loadIframe(id) {
var x = document.getElementById(id)
var today = new Date()
if (x.style.display != 'block') {
x.style.display = 'block'
x.src = "jobs" + today.getFullYear() + today.getMonth() + today.getDay()
+".html"
}
else
x.style.display = 'none'
}

CSS
#News { height: 250px; width: 400px; }

You could force the iframe to open initially, e.g.
<body onload = "loadIframe('News')" >
 
Back
Top