super70s
12/27/2015 4:25:00 PM
One of the features on my site is putting up the No. 1 single and LP a
certain amount of years ago (currently alternating between 40 or 45
years ago every week, as the years progress it will eventually be
45/50). I do this according to what week of the year it is currently,
and have been doing this manually every week for a long time.
I was just wondering if there's a good JS I could use for this, say put
all 52 weekly items in a separate file and then have the appropriate
item come up according to what week it is?
I have a "birthday" JS on the same page that's worked pretty well for me
over the years, I just have to change it each month....
<script language="JavaScript">
<!-- Begin
var msg = new Array();
Stamp = new Date();
today = Stamp.getDate();
msg[1] = "Dan Peek (11/1/50)<a href=america.html><img src=arrow1.gif
width=12 height=11 border=0 align=bottom></a>";
msg[2] = "Keith Emerson (11/2/44)<a href=spemersonlp3.html><img
src=arrow1.gif width=12 height=11 border=0 align=bottom></a>";
(ect.)
(ect.)
(ect.)...
msg[30] = "Dick Clark (11/30/29)<a href=extra_12_5.html><img
src=arrow1.gif width=12 height=11 border=0 align=bottom></a>";
function writeTip() {
document.write(msg[today]);
}
// End -->
</script>
However the items for that are a lot simpler than what I need for the
weekly No. 1's, an example of which is...
<p> <font size="2" face="arial"><I>Week Ending January
3, 1976</I></font><a href="sdmc_73_Jan_76.html"><img src="arrow3.gif"
width="12" height="11" border="0" align="bottom"></a><br>
<font color="#e06213">•</font> <font size="2"
face="arial">#1 45: "Saturday Night"<br> - Bay City
Rollers</font><a href="sw_saturdaynight.html"><img src="arrow3.gif"
width="12" height="11" border="0" align="bottom"></a><br>
<font color="#e06213">•</font> <font size="2"
face="arial">#1 LP: <cite>Chicago IX - Chicago's</cite><br>
<cite>Greatest Hits</cite> - Chicago</font><a
href="spchicago9.html"><img src="arrow3.gif" width="12" height="11"
border="0" align="bottom"></a></p>
I just don't know if this could work with the HTML markup that's
required for the above, when I tried to insert HTML (say, bold text) for
the birthday one, it wouldn't work at all.
Is what I want to do possible with javascript, or am I stuck with
manually updating this thing each week? Just curious.