I have a table that is in a form. The top row of the table displays a logo in the first <td> element and in the second <td> element I have today’s date. If I put all of the script code right in the <td> such as this….
[code=php]<td align=’right’>
<script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym=”0″+daym
var dayarray=new Array(“Sunday”,”Monday”,”Tuesday”,”Wednesday”,”Thursday”,”Friday”,”Saturday”)
var montharray=new Array(“January”,”February”,”March”,”April”,”May”,”June”,”July”,”August”,”September”,”October”,”November”,”December”)
document.write(“<small><font color=’000000′ face=’Arial’><b>”+dayarray[day]+”, “+montharray[month]+” “+daym+”, “+year+”</b></font></small>”)
</script>
</td>
this works just fine. It displays the date perfectly. But I have this as a standard throughout the different pages on the site so I what I want to do is make a date.js and just call the function getDate(). This is what I have tried…
[code=php]<td align=’right’><SCRIPT language=”javascript” src=”date.js”>getDate();</SCRIPT></td>
This however does nothing. What am I missing? Is it possible to call it like this??
thanks a ton…