I'm currently attempting to show a scrolling marquee when the value of my variable doesn't read "NO CURRENT ADVISORIES". If other than that, it will scroll a message, allowing the user to click on the marquee and a new web page will be displayed.
My variable is in an xml file, and I'm using the "document.getElementById" statement. It is reading the xml just fine. I'm not sure of the code needed transferring "message" to my IF statement.
I'm not having any success doing it.:(
(The div id statement is being used as a test making sure I'm pulling the xml value correctly, and it is working.)
Code:
<html>
<head>
<script type="text/javascript">
var xmlDoc
function loadXML()
{
//load xml file
// code for IE
if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("http://www.jlocon.com/wdfulldata.xml");
getmessage()
}
// code for Mozilla, etc.
else if (document.implementation &&
document.implementation.createDocument)
{
xmlDoc= document.implementation.createDocument("","",null);
xmlDoc.load("http://www.jlocon.com/wdfulldata.xml");
xmlDoc.onload=getmessage
}
else
{
alert('Your browser cannot handle this script');
}
}function getmessage()
{
document.getElementById("message").innerHTML=xmlDoc.getElementsByTagName("noaaw")[0].firstChild.nodeValue;
}
<!--
if (message != "NO CURRENT ADVISORIES")
{
document.write("<table border='1' cellpadding='0' cellspacing='0' width=550 bgcolor='RED'><tr><td><a
href='http://www.jlocon.com/laridx.htm'><marquee scrolldelay='125'
width='550'>NORTHERN ILLINOIS-CHICAGO AREA - WEATHER WARNING ISSUED ... [Click here for details]
</marquee></a></td></tr></table><br>");}
//-->
</script>
</head>
<body onload="loadXML()">
<div id="message" style="background-color:pink"></div>
</body>
</html>
Lar