View Single Post
  #1 (permalink)  
Old July 15th, 2005, 05:22 AM
losmon losmon is offline
Registered User
 
Join Date: Jul 2005
Location: Elgin, IL, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transferring a variable value

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
Reply With Quote