Get weather from Yahoo with jQuery

2019-08-15 00:12发布

I'm using the Google API to get a user's location on this site. How would I go about getting the weather for that user from Yahoo or somewhere?

UPDATE: Ok so I'm going with Yahoo, but I've never done an HTTP GET request before. Im using jQuery and the following code:

function getWeather () {
            $.get("http://weather.yahooapis.com/forecastrss?w=2502265", function(data){
               alert("Data Loaded: " + data);
             });
        }

However, the alert is only returning "Data loaded", and the rest is blank, so I'm doing something wrong but not sure what.

Also, I need a way of taking my latitude and longitude and fiding the WOEID for them

1条回答
看我几分像从前
2楼-- · 2019-08-15 01:08

Read about Yahoo Weather, you can pass the location as parameter to their API url and it will give you the result:

http://developer.yahoo.com/weather/

查看更多
登录 后发表回答