Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML error on grabbing recordset data.

Status
Not open for further replies.

nwyork

Programmer
Oct 23, 2004
26
US
I'm using this xml to grab data to show in a browser.

<?xml version="1.0" encoding="UTF-8" ?>
- <recordset>
<tablecols>3</tablecols>
<fontcolor>9933CC</fontcolor>
<linkcolor>33FF33</linkcolor>
<bgcolor>99FFFF</bgcolor>
<tablewidth>400</tablewidth>
- <slot>
<description>Test 1</description>
<image>C:\somewhere</image>
<link>none</link>
<price>1.0000</price>
</slot>
- <slot>
<description>Test 3</description>
<image />
<link>none</link>
<price>3.0000</price>
</slot>
</recordset>

I keep getting this error:

Error: req.responseXML has no properties
Source File: Line: 32

Any suggestions on solutions will be appreciated.

Thanks
 
I think we need some more information to help.

Jon

"There are 10 types of people in the world... those who understand binary and those who don't.
 
Here is the javascript code

var req;

function init () {
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}

req.open("GET", " true);
req.onreadystatechange = callback;
req.send(null);
parseMessage();
}

function callback() {
if (req.readyState == 4) {
if (req.status == 200) {
// update the HTML DOM based on whether or not message is valid
}
}
}

function parseMessage() {
var TextColor = req.responseXML.getElementsByTagName("fontcolor")[0];
alert(TextColor.childNodes[0].nodeValue);

}

Sorry about that I thought I copied the code in here. Here is the javascript I used. It works in IE browser but not in FireFox. The req.responseXML is Null in the FireFox browser.

Thanks
Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top