Hello,
I have the following script that used to work with FF2. Now I get under FF3:
TypeError: document.getElementByID('content') is null
SCRIPT:
function Sounding(){
var yr = "08";
var myArray = new Array();
myArray[0] = new Date() ;
var mes = (myArray[0].getMonth() );
if (mes.length = 2)
{
mes = mes +1;
mes = "0"+mes;
}
var day = (myArray[0].getDate() );
if (day.length = 1)
{
day = "0" + day;
}
var align= '<p align="center">';
var img = '<img src="';
var http = 'http://www.spc.noaa.gov/exper/soundings';
var slash = '\/';
var obs = '12_OBS/OAX.gif">';
var theString=align+img+http+slash+yr+mes+day+obs+"</p>";
alert(theString);
document.getElementById('content').innerHTML=theString;
}
window.onload=Sounding;
EXPLANATION:
The code created should look like this:
<p align="center"><img src="http://www.spc.noaa.gov/exper/soundings/08070112_OBS/OAX.gif"></p>
is displayed correctly (alert) but it ends up issuing the error message above (in red font).
Could anyone tell me what is wrong here? I can't find the problem.
OBSERVATION:
the part where it reads 080701 changes daily(obvious). But if in a test no results are shown and no message is issued, the try to change 12OBS to 00OBS.
The result should be a very "weird" looking meteorological stuff.
Thanks for any help