Jump to content

Javascript and XML in IE6 and FF3


rhyspaterson

Recommended Posts

Hey lads,

 

We use IE6 as the standard browser in our SOE at work (so i have been developing for it). However i just noticed this the other day:

 

<script type="text/javascript">
function parseXML()
{
try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
    {
    xmlDoc=document.implementation.createDocument("","",null);
    }
  catch(e)
    {
    alert(e.message);
    return;
    }
  }
xmlDoc.async=false;
xmlDoc.load("scheduled_files/required_files/printers.xml");
document.getElementById("clear").innerHTML=xmlDoc.getElementsByTagName("clear")[0].childNodes[0].nodeValue;
document.getElementById("attention").innerHTML=xmlDoc.getElementsByTagName("attention")[0].childNodes[0].nodeValue;
document.getElementById("critical").innerHTML=xmlDoc.getElementsByTagName("critical")[0].childNodes[0].nodeValue;
}
</script>

....

<div class="navitem">
  <ul>
    <li class="green"><span id="clear">?</span> are clear</li>
    <li class="yellow"><span id="attention">?</span> require attention</li>
    <li class="red"><span id="critical">?</span> are critical</li>
  </ul>
</div>

 

The '?'s are updated fine in IE6, but not FF3. Obviously it is some quite basic change, but cross browser javascript is all still quite new to me :P

 

The XML file looks as such:

 

<printers>
<clear>48</clear>
<attention>21</attention>
<critical>17</critical>
<total>86</total>
</printers>

 

Suggestions?

 

Cheers :P

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.