Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > RSS and Atom
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
RSS and Atom Ask questions, get answers, discuss creating RSS and Atom feeds or programming apps or sites that create or consume RSS/Atom. Please leave any RSS/Atom politics out of this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the RSS and Atom section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 9th, 2006, 09:24 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default responseXML in IE

Hi all,
Please help me out of this quagmire,

I have an application in which i retrieve data from XML file named, data.xml, and display it in TRs in html page, named ajaxexample.html.

It is working fine in Firefox, but seems to have some issues in IE.

The content of html file is as below:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript"><!--
function ajaxRead(file){
var xmlObj = null;
if(window.XMLHttpRequest){
xmlObj = new XMLHttpRequest();
} else if(window.ActiveXObject){
xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
return;
}
xmlObj.onreadystatechange = function(){
if(xmlObj.readyState == 4){
processXML(xmlObj.responseXML);

}
}
xmlObj.open ('GET', file, true);
xmlObj.send ('');
}
function processXML(obj){
var dataArray = obj.getElementsByTagName('pet');
var dataArrayLen = dataArray.length;
var insertData = '<table style="width:150px; border: solid 1px #000"><tr><th>'
+ 'Pets</th></tr>';
for (var i=0; i<dataArrayLen; i++){
insertData += '<tr><td>' + dataArray[i].firstChild.data + '</td></tr>';
}
insertData += '</table>';
document.getElementById ('dataArea').innerHTML = insertData;
}
//--></script>
</head>
<body>
<h1>Developing Web Applications with Ajax</h1>

<p>This page particularly demonstrates the retrieval and processing of grouped sets of XML data.
The data retrieved will be output into a tabular format below.
<a href="#" onClick="ajaxRead('data.xml'); return false">See the demonstration</a>.</p>
<div id="dataArea"></div>
</body>
</html>


The content of xml file (data.xml):
<?xml version="1.0" encoding="UTF-8"?>
<data>
<pets>
<pet>Cat</pet>
<pet>Dog</pet>
<pet>Horse</pet>
</pets>
</data>

Please help me out.

Thanks in advance

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ResponseXML property of XMLHTTPRequest Object prashantshekhar BOOK: Beginning Ajax with ASP.NET 0 August 14th, 2007 12:49 AM
responseXML in IE tannu XML 1 February 9th, 2006 12:54 PM



All times are GMT -4. The time now is 05:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.