0

Weather RSS Feed does not work on Firefox 3

Hi there,

I tried to use the weather RSS Feed provided by yahoo and followed the way on the page http://developer.yahoo.com/weather/
.

The following code is what I done with the XML from feed(http://weather.yahooapis.com/forecastrss?p=ASXX0089&u=c). It works very well on IE6. I can pull out all the data contained in the XML file and reuse it. But on Firefox 3 , the javascript console always give a error message highlighted in red.

"uncaught exception: Access to restricted URI denied (NS_ERROR_DOM_BAD_URI)
[Break on this error] xmlDoc.load("http://weather.yahooapis.com/forecastrss?p=ASXX0089&u=c");"


Could you please help me to fix this problem.

Many thanks.

<CODE>
<script type="text/javascript">

// predeclare to prevent strict js error.
var xmlDoc;

// For IE based browsers:
if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
}

// For Mozilla based (standards compliant) browsers:
else if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("","doc",null);
}

// Turn off asynchronus download.
// In other words, load the entire file before trying to do anything with it.
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load("http://weather.yahooapis.com/forecastrss?p=ASXX0089&u=c");

function verify()
{
// 0 Object is not initialized
// 1 Loading object is loading data
// 2 Loaded object has loaded data
// 3 Data from object can be worked with
// 4 Object completely initialized
if (xmlDoc.readyState != 4 )
{ document.getElementById("loading").innerHTML = '';

}
}

</CODE>

by
3 Replies
  • Jackie,

    I've reached out to the Weather team to get you an answer. Thanks for letting us know about this.

    Robyn Tippins
    Community Manager, YDN
    0
  • QUOTE (Duzins @ Feb 25 2009, 12:46 PM) <{POST_SNAPBACK}>
    Jackie,

    I've reached out to the Weather team to get you an answer. Thanks for letting us know about this.

    Robyn Tippins
    Community Manager, YDN


    Hi Robyn,

    Thanks a lot for your reply.

    Look forward to hearing from you guys soon.

    Cheers, mate.
    0
  • The RSS feed itself seems to come thru correctly, even in FF3:
    http://weather.yahooapis.com/forecastrss?p=ASXX0089&u=c

    It may have been a temporal error, or something in the way your code is trying to parse the XML feed returned.
    0

Recent Posts

in General Discussion at YDN