- 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!
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!