"John Lund" <> wrote in
news:_E3fb.18267$:
> How does one write JavaScript code for an image of something that
> happened or appeared on this date? For example, today (as I'm writing
> this) is October 2nd, and I would like to have an image of something
> that happened on October 2nd.
>
<script>
function two(x) {return ((x>9)?"":"0")+x}
d = new Date();
img = "happened"+two(getMonth(d)+1)+two(getDate(d))+".jp g"
document.write("<img src='"+img+"'>")
// This shows the image "happened1002.jpg" on your date
</script>
not tested!
|