Jump to content

getElemenByTagName() on IE + Firefox


winicius

Recommended Posts

The following code works perfectly on Firefox rendering the page according to a predefined CSS file. The issue I am having now is that IE 7 is unable to append the element list[0] which denotes a Node. While I'm getting the information from the XML file loading properly with Firefox, IE is not displaying anything. Down below I put part of my javascript with the XML file that the information is being extracted from. Maybe someone out there has already had a problem similar to this, any help is greatly appreciated. Thanks.

 

Javascript:

function buildContent(){
var contentsec = document.getElementById("infocontent");
var list = req.responseXML.getElementsByTagName("content");
        contentsec.appendChild(list[0]);
}

 

XML

<?xml version="1.0" encoding="utf-8"?>

<content>
<h1>Blah Blah Blah</h1>
<h2>Blah Blah Blah Blah Blah Blah</h2>

</content>

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.