Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

problem with getElementsByTagName not working in IE7

Anyone else had this problem? I run this code in firefox 2 and it works fine but I get a length of 0 in IE.

thanks in advance
function handleReportData(reportData)
{
var results = xmlHttp.responseXML;
alert(results);
alert("gets to handle data");
var report, reportID, displayName, fileName, reportDesc;
var reports = results.getElementsByTagName("report");
//alert(results.getElementById("JPOform").displayName);
alert(reports.length);
for(var i = 0; i < reports.length; i++)
{
report = reports[i];
reportID = report.getAttribute("id");
displayName = report.getAttribute("displayName");
fileName = report.getAttribute("fileName");
reportDesc = report.getAttribute("desc");
alert(reportID+" "+displayName+" "+reportDesc+" "+fileName);
addReportRow(reportID,displayName,reportDesc,fileName);
}
}

UPDATE:

Ok guys well I guess it is a problem w/ MS dropping the ball yet again. It appears that although MS finally conformed thier xmlHttprequest object to industry standard, IE does not support responseXML. The work around? Write it out to a div tag and get the div tag as the dom. What a crock anyone have a better idea?

Link (http://www.codingforums.com/archive/index.php?t-79228.html)
[1553 byte] By [partyk1d24] at [2007-11-11 10:09:41]