Click to See Complete Forum and Search --> : buggy xml(from php) tying up IE


mlecho
07-10-2007, 06:21 AM
hi all...i think this question will belong here. i am making an ajax application. The XMLHttpRequest works great for all my scripts except this one:

<?php
header("Content-Type: text/xml");
include("contact/local.php");
$table="news_b";
$query="SELECT * FROM $table ORDER BY Id DESC";
$result=mysql_query($query);
echo("<news>");
while($answer=mysql_fetch_assoc($result)){
echo ("<entry>");
echo ("<id>".$answer['Id']."</id>");
echo ("<date>".$answer['Date']."</date>");
echo ("<title>".$answer['Title']."</title>");
echo ("<text>".$answer['Text']."</text>");
echo("</entry>");
}
echo ("</news>");
?>

firefox has no problems, but IE sees it as response.Text..... i have other php scripts along the same format for an image gallery that works fine in both browsers....what am i doing wrong? Or do i need to move this question to the Javascript forum?

FYI- i did script this in hard xml to test on IE, and then it worked, so something buggy is happening in the php....i think.

temp.user123
07-10-2007, 12:52 PM
I've seen this problem before. If I remember correctly, I think IE requires the DOCTYPE to be specified for XML (or something like that) -- rather than just going by the content-type.

temp.user123
07-10-2007, 12:54 PM
Guess you found that out here:

http://www.webdeveloper.com/forum/showthread.php?t=154246

cluettr
07-12-2007, 12:31 AM
Check to be sure you are not caching the xml... at the very end of your xml script in the address bar add ?id=234980 or some random value... this will make it look like a different page and won't pull it from you cache. Alternatively you can delete your cache in the browser and reload... I run into this crap all the time with IE6 and IE7.