yql を使用する場合は、次のリンクを参照してください。
http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20location%3D%223015%22&format=json
それを呼び出すときは、それをjqueryのパラメーターとして渡すだけです。したがって、STeve のコードを使用する他の方法では、getJSON 関数呼び出しに渡された URL を yql リンクに置き換えるだけでよく、もちろん場所に使用する郵便番号を置き換えることもできます。コードは次のとおりです。
$(document).ready(DocReady);
function DocReady()
{
var Result = $.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20location%3D%2233015%22&format=json", "",
function (data)
{
$("body").append("Sunrise: " + data.query.results.channel.astronomy.sunrise + "<br />");
$("body").append("SuntSet: " + data.query.results.channel.astronomy.sunset + "<br />");
});
}
適切な場所を取得するために置き換える必要があるセクションは次のとおりです。
両方の %22 の間の郵便番号を入力してください
http://query.yahooapis.com/v1/public/yql?q=select%20 *%20from%20weather.forecast%20where%20location%3D%22
33333
%22&format=json
ご不明な点がございましたら、お知らせください。