rgn1703
01-24-2005, 06:24 PM
I created a java script that is supposed to change the background image on my page every month but it is not working as I intended (the image does not load as the background) Here is the cod I used:
function mybackground()
{
var mymonth=["JAN","FEB","MAR","APR","MAY","JUNE","JULY","AUG","SEPT","OCT","NOV","DEC"];
var mydate=new Date();
var mo=mydate.getMonth();
var monthimage="<img src='../" + mymonth[mo] +"2005.jpg'>"
document.write('monthimage')
}
and this is where the code is to be executed:
<body background="<javascript='mybackground()'>" onload="setInterval('show()',1000);">
Can anyone tell me what I did wrong and why my image will not load as the background?
Ron
:confused: :confused:
function mybackground()
{
var mymonth=["JAN","FEB","MAR","APR","MAY","JUNE","JULY","AUG","SEPT","OCT","NOV","DEC"];
var mydate=new Date();
var mo=mydate.getMonth();
var monthimage="<img src='../" + mymonth[mo] +"2005.jpg'>"
document.write('monthimage')
}
and this is where the code is to be executed:
<body background="<javascript='mybackground()'>" onload="setInterval('show()',1000);">
Can anyone tell me what I did wrong and why my image will not load as the background?
Ron
:confused: :confused: