Problem with firefox

Joined
Aug 25, 2007
Messages
79
Reaction score
0
hi everyone,

i got a problem with firefox, the problem is that when i run this htm page and type in the rss i want to view it does not work. However if i run it with IE it works fine?? i dont kno where iam going wrong.
here is the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>HTMLPage1.htm</title>
</head>

<body>

<script type="text/javascript">
var xmlDoc=null;
if (window.ActiveXObject)
{// code for IE
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
else if (document.implementation.createDocument)
{// code for Mozilla, Firefox, Opera, etc.
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}

if (xmlDoc!=null)
{
var name = prompt("Enter RSS feed", "Enter RSS feed");


xmlDoc.async=false;
xmlDoc.load(name +".xml");
var x=xmlDoc.getElementsByTagName("item");

document.write("<table border='1'>");
for (var i=0;i<x.length;i++)
{
document.write("<tr>");
document.write("<td>");
document.write(x.getElementsByTagName("title")[0].childNodes[0].nodeValue);
document.write("</td>");

document.write("<td>");
document.write(x.getElementsByTagName("pubDate")[0].childNodes[0].nodeValue);
document.write("</td>");

document.write("<td>");
document.write(x.getElementsByTagName("description")[0].childNodes[0].nodeValue);
document.write("</td>");

document.write("</tr>");
}
document.write("</table>");
}
</script>

</body>
</html>

if you run this in IE it works, btw when you type in the link to the rss feed dont enter .xml at the end.
Please if any one works this out i will be most grateful!
bowdown.gif
 
I can't get this to work on IE7 either? :(

Not sure where you're going wrong as I'm not up to speed on XML :o
 
it really should work on IE7 cos thats the only way i get it to work. O well i guess i got to do some more research on xml. btw when u put the code in notepad did you save it as html?
 
I've just re-tried it in IE7 - I didn't see the bit about missing .rss on the end, it works ok in IE7 now :)

Good luck! :thumb:
 
Back
Top