|
|
#1 (permalink) |
|
New Member
![]() Join Date: Sep 2008
Posts: 2
|
I have a couple of situations where I am tired of updating a date and would like to do it automatically. I am not an expert programmer, but I am pretty good at inserting spaghetti code and making already existing code work in my website; however, I haven't been able to find what I need for this:
Code:
<select name="menuopts" onChange="goDestination(document.mymenu.menuopts.options[document.mymenu.menuopts.options.selectedIndex].value)">
<option>Quick Links...</option>
<option value="guestbook.html">Community</option>
<option value="credits.html">Credits</option>
<option value="pages/Sep2008.html">Current Diary Page</option>
<option value="main.html">Main Page</option>
</select>
Here is my second question: I have a line that looks like this on the same page: Code:
<font face="Comic Sans MS" size="1">Last Updated September 14th, 2008</i></font></p> Any help is greatly appreciated. Thanks a bundle! |
|
|
|
|
|
#4 (permalink) |
|
Moderator
![]() Join Date: Jun 2008
Posts: 365
|
To make the link dynamic is pretty easy, this should do what you need:
Code:
<script type="text/javascript">
function getMonthFile() {
var months = new Array(12);
today = new Date();
months[0] = "Jan";
months[1] = "Feb";
months[2] = "Mar";
months[3] = "Apr";
months[4] = "May";
months[5] = "Jun";
months[6] = "Jul";
months[7] = "Aug";
months[8] = "Sep";
months[9] = "Oct";
months[10] = "Nov";
months[11] = "Dec";
return "pages/" + months[today.getMonth()] + today.getFullYear() + ".html";
}
</script>
<body>
<a onmouseover="this.href=getMonthFile();" >test</a>
</body>
HTH, JC |
|
|
|
|
|
#5 (permalink) |
|
Bronze Member
![]() Join Date: Aug 2008
Location: Dallas, Tx
Posts: 83
|
I think with what you're wanting you'll need to go to a server side language. I don't think jnjc's suggestion will help because you're wanting something to be there when the page loads and javascript really can't do that to my knowledge.
|
|
|
|
![]() |
| Tags |
| dates |
| Thread Tools | |
| Display Modes | |
|
|